1+ import { VerticalTextAlignment , verticalTextAlignmentProperty } from '@nativescript-community/text' ;
12import { themer } from '@nativescript-community/ui-material-core' ;
23import {
34 buttonColorProperty ,
@@ -12,26 +13,23 @@ import {
1213 helperProperty ,
1314 strokeColorProperty ,
1415 strokeDisabledColorProperty ,
15- strokeInactiveColorProperty ,
16+ strokeInactiveColorProperty
1617} from '@nativescript-community/ui-material-core/textbase/cssproperties' ;
1718import {
1819 Background ,
1920 Color ,
2021 Font ,
21- Property ,
22- Screen ,
2322 Style ,
2423 Utils ,
2524 _updateCharactersInRangeReplacementString ,
2625 backgroundInternalProperty ,
2726 editableProperty ,
2827 fontInternalProperty ,
29- isAndroid ,
3028 paddingBottomProperty ,
3129 paddingLeftProperty ,
3230 paddingRightProperty ,
3331 paddingTopProperty ,
34- placeholderColorProperty ,
32+ placeholderColorProperty
3533} from '@nativescript/core' ;
3634import { textProperty } from '@nativescript/core/ui/text-base' ;
3735import { TextFieldBase } from './textfield.common' ;
@@ -180,7 +178,6 @@ export class TextField extends TextFieldBase {
180178
181179 _getTextInsetsForBounds ( insets : UIEdgeInsets ) : UIEdgeInsets {
182180 const style = this . style ;
183-
184181 if ( this . variant === 'underline' && this . _controller . underlineHeightNormal === 0 ) {
185182 // if no underline/custom background, remove all insets like on android
186183 insets . top = 0 ;
@@ -358,4 +355,24 @@ export class TextField extends TextFieldBase {
358355 const font = value instanceof Font ? value . getUIFont ( this . _controller . inlinePlaceholderFont ) : value ;
359356 this . _controller . inlinePlaceholderFont = font ;
360357 }
358+
359+ [ verticalTextAlignmentProperty . setNative ] ( value : VerticalTextAlignment ) {
360+ // TODO: not working for now
361+ const view = this . nativeTextViewProtected ;
362+ view . backgroundColor = UIColor . redColor ;
363+ switch ( value ) {
364+ case 'initial' :
365+ case 'top' :
366+ view . contentVerticalAlignment = UIControlContentVerticalAlignment . Top ;
367+ break ;
368+ case 'middle' :
369+ view . contentVerticalAlignment = UIControlContentVerticalAlignment . Center ;
370+
371+ break ;
372+
373+ case 'bottom' :
374+ view . contentVerticalAlignment = UIControlContentVerticalAlignment . Bottom ;
375+ break ;
376+ }
377+ }
361378}
0 commit comments