Additional fixes

This commit is contained in:
Rossen Hristov
2016-03-18 14:57:28 +02:00
parent 6c68423ee9
commit ed090326b1
6 changed files with 10 additions and 6 deletions

View File

@ -320,7 +320,7 @@ export var test_WhenFormattedTextPropertyChanges_TextIsUpdated_Button = function
view.formattedText = formattedString2;
TKUnit.assertEqual(view.text, "SecondThird");
formattedString2.spans[0].text = "Mecond";
formattedString2.spans.getItem(0).text = "Mecond";
TKUnit.assertEqual(view.text, "MecondThird");
view.formattedText = null;

View File

@ -497,7 +497,7 @@ export var test_WhenFormattedTextPropertyChanges_TextIsUpdated_TextBase = functi
view.formattedText = formattedString2;
TKUnit.assertEqual(view.text, "SecondThird");
formattedString2.spans[0].text = "Mecond";
formattedString2.spans.getItem(0).text = "Mecond";
TKUnit.assertEqual(view.text, "MecondThird");
view.formattedText = null;

View File

@ -45,8 +45,9 @@ export class Button extends common.Button {
}
public _setFormattedTextPropertyToNative(value) {
var newText = value ? value._formattedText : null;
if (this.android) {
this.android.setText(value._formattedText);
this.android.setText(newText);
}
}
}

View File

@ -64,7 +64,8 @@ export class Button extends common.Button {
// the UIControlStateNormal value. If the value for UIControlStateNormal is not set,
// then the property defaults to a system value. Therefore, at a minimum, you should
// set the value for the normal state.
this.ios.setAttributedTitleForState(value._formattedText, UIControlState.UIControlStateNormal);
var newText = value ? value._formattedText : null;
this.ios.setAttributedTitleForState(newText, UIControlState.UIControlStateNormal);
this.style._updateTextDecoration();
}
}

View File

@ -10,8 +10,9 @@ export class TextBase extends common.TextBase {
}
}
public _setFormattedTextPropertyToNative(value) {
var newText = value ? value._formattedText : null;
if (this.android) {
this.android.setText(value._formattedText);
this.android.setText(newText);
}
}
}

View File

@ -11,7 +11,8 @@ export class TextBase extends common.TextBase {
}
public _setFormattedTextPropertyToNative(value) {
this.ios.attributedText = value._formattedText;
var newText = value ? value._formattedText : null;
this.ios.attributedText = newText;
this.style._updateTextDecoration();
this.style._updateTextTransform();
this.requestLayout();