File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 9
9
" android.text:Layout" ,
10
10
" android.os:Build" ,
11
11
" android.util:TypedValue" ,
12
+ " android.view:LayoutInflater" ,
12
13
" android.graphics:Paint" ,
13
14
" android.graphics:Paint.FontMetrics" ,
14
15
" android.text:Spanned" ,
Original file line number Diff line number Diff line change @@ -215,6 +215,8 @@ abstract class LabelBase extends View implements LabelViewDefinition {
215
215
protected _paintFlags : number ;
216
216
}
217
217
218
+ let layoutId ;
219
+ let LayoutInflater : typeof android . view . LayoutInflater ;
218
220
export class Label extends LabelBase {
219
221
nativeViewProtected : com . nativescript . text . TextView ;
220
222
handleFontSize = true ;
@@ -228,10 +230,18 @@ export class Label extends LabelBase {
228
230
229
231
@profile
230
232
public createNativeView ( ) {
231
- if ( ! TextView ) {
232
- TextView = com . nativescript . text . TextView ;
233
+ // if (!TextView) {
234
+ // TextView = com.nativescript.text.TextView;
235
+ // }
236
+ // return new TextView(this._context);
237
+ if ( ! layoutId ) {
238
+ const context = Utils . android . getApplicationContext ( ) ;
239
+ layoutId = context . getResources ( ) . getIdentifier ( 'label' , 'layout' , context . getPackageName ( ) ) ;
233
240
}
234
- return new TextView ( this . _context ) ;
241
+ if ( ! LayoutInflater ) {
242
+ LayoutInflater = android . view . LayoutInflater ;
243
+ }
244
+ return LayoutInflater . from ( this . _context ) . inflate ( layoutId , null , false ) ;
235
245
}
236
246
urlSpanClickListener : com . nativescript . text . URLSpanClickListener ;
237
247
public disposeNativeView ( ) {
You can’t perform that action at this time.
0 commit comments