mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
committed by
Nathan Walker
parent
66d8afffc1
commit
aa1c631e6f
@@ -292,7 +292,8 @@ export class TextBase extends TextBaseCommon {
|
||||
case 'right':
|
||||
this.nativeTextViewProtected.setGravity(android.view.Gravity.END | verticalGravity);
|
||||
break;
|
||||
default: // initial | left | justify
|
||||
default:
|
||||
// initial | left | justify
|
||||
this.nativeTextViewProtected.setGravity(android.view.Gravity.START | verticalGravity);
|
||||
break;
|
||||
}
|
||||
@@ -485,14 +486,9 @@ export class TextBase extends TextBaseCommon {
|
||||
}
|
||||
|
||||
function getCapitalizedString(str: string): string {
|
||||
const words = str.split(' ');
|
||||
const newWords = [];
|
||||
for (let i = 0, length = words.length; i < length; i++) {
|
||||
const word = words[i].toLowerCase();
|
||||
newWords.push(word.substr(0, 1).toUpperCase() + word.substring(1));
|
||||
}
|
||||
|
||||
return newWords.join(' ');
|
||||
let newString = str.toLowerCase();
|
||||
newString = newString.replace(/(?:^|\s|[-"'([{])+\S/g, (c) => c.toUpperCase());
|
||||
return newString;
|
||||
}
|
||||
|
||||
export function getTransformedText(text: string, textTransform: CoreTypes.TextTransformType): string {
|
||||
|
||||
Reference in New Issue
Block a user