Gianni Sassanelli Active Member Licensed User Longtime User Aug 17, 2021 #1 Hi as by subject, is ther any way to change appearance of B4xFloatTextLabel sub views by code I need for example to increase space betwheen label (hint) and field as in above screen shot (PAD equivalent of B4A) also I would like change font style Last edited: Aug 17, 2021
Hi as by subject, is ther any way to change appearance of B4xFloatTextLabel sub views by code I need for example to increase space betwheen label (hint) and field as in above screen shot (PAD equivalent of B4A) also I would like change font style
Erel B4X founder Staff member Licensed User Longtime User Aug 17, 2021 #2 You can set HintLabelLargeOffsetX, HintLabelSmallOffsetY and HintLabelSmallOffsetX. Make sure to call B4XFloatTextField.Update after modifying these fields. Upvote 0
You can set HintLabelLargeOffsetX, HintLabelSmallOffsetY and HintLabelSmallOffsetX. Make sure to call B4XFloatTextField.Update after modifying these fields.
Gianni Sassanelli Active Member Licensed User Longtime User Aug 17, 2021 #3 LucaMs said: (just to say: remove that image!) Click to expand... You know Dogma Luca? Upvote 0
LucaMs Expert Licensed User Longtime User Aug 17, 2021 #4 Gianni Sassanelli said: You know Dogma Luca? Click to expand... No, obviously; I just wanted to say that that image you posted may not be adequate (for privacy reasons) (I searched for that name) Upvote 0
Gianni Sassanelli said: You know Dogma Luca? Click to expand... No, obviously; I just wanted to say that that image you posted may not be adequate (for privacy reasons) (I searched for that name)
Gianni Sassanelli Active Member Licensed User Longtime User Aug 17, 2021 #5 LucaMs said: No, obviously; I just wanted to say that that image you posted may not be adequate (for privacy reasons) (I searched for that name) Click to expand... You are right! thank's Upvote 0
LucaMs said: No, obviously; I just wanted to say that that image you posted may not be adequate (for privacy reasons) (I searched for that name) Click to expand... You are right! thank's
Gianni Sassanelli Active Member Licensed User Longtime User Aug 17, 2021 #6 Erel said: You can set HintLabelLargeOffsetX, HintLabelSmallOffsetY and HintLabelSmallOffsetX. Make sure to call B4XFloatTextField.Update after modifying these fields. Click to expand... don't solve because HintLabelSmallOffsetY move only the label but i want to move the textfield with B4A i do B4X: fld.TextField.Padding = Array As Int (5dip,5dip,0dip,0dip) but in B4I is not supported Upvote 0
Erel said: You can set HintLabelLargeOffsetX, HintLabelSmallOffsetY and HintLabelSmallOffsetX. Make sure to call B4XFloatTextField.Update after modifying these fields. Click to expand... don't solve because HintLabelSmallOffsetY move only the label but i want to move the textfield with B4A i do B4X: fld.TextField.Padding = Array As Int (5dip,5dip,0dip,0dip) but in B4I is not supported
Erel B4X founder Staff member Licensed User Longtime User Aug 17, 2021 #7 What exactly do you want to move? Why aren't you doing it in the designer script? You can move the control with fld.mBase.SetLayoutAnimated. You will need to do it in Page_Resize event Upvote 0
What exactly do you want to move? Why aren't you doing it in the designer script? You can move the control with fld.mBase.SetLayoutAnimated. You will need to do it in Page_Resize event
Gianni Sassanelli Active Member Licensed User Longtime User Aug 17, 2021 #8 Sorry Erel, but this is what I need Upvote 0
Semen Matusovskiy Well-Known Member Licensed User Aug 17, 2021 #9 1) If B4XFloatTextField is Multiline, B4i uses a TextView. In this case it's possible https://developer.apple.com/documentation/uikit/uitextview/1618619-textcontainerinset B4X: Dim no As NativeObject = B4XFloatTextField1.TextField no.RunMethod("setTextContainerInset:", Array (no.MakeEdgeInsets (8, 0, 8, 0))) Of course, change standard values. 2) If B4XFloatTextField is Singleline, B4i uses a TextField. In this case it's possible to use leftView and rightView properties. For example: B4X: #If OBJC - (void) setInsets : (UITextField *) textField : (int) paddingLeft : (int) paddingRight { textField.leftView = [[UIView alloc] initWithFrame: CGRectMake (0, 0, paddingLeft, 0)]; textField.rightView = [[UIView alloc] initWithFrame: CGRectMake (0, 0, paddingRight, 0)]; textField.leftViewMode = UITextFieldViewModeAlways; textField.rightViewMode = UITextFieldViewModeAlways; } #End If Call B4X: Dim no As NativeObject = Me no.RunMethod ("setInsets:::", Array (B4XFloatTextField2.TextField, 50, 75)) Last edited: Aug 17, 2021 Upvote 0
1) If B4XFloatTextField is Multiline, B4i uses a TextView. In this case it's possible https://developer.apple.com/documentation/uikit/uitextview/1618619-textcontainerinset B4X: Dim no As NativeObject = B4XFloatTextField1.TextField no.RunMethod("setTextContainerInset:", Array (no.MakeEdgeInsets (8, 0, 8, 0))) Of course, change standard values. 2) If B4XFloatTextField is Singleline, B4i uses a TextField. In this case it's possible to use leftView and rightView properties. For example: B4X: #If OBJC - (void) setInsets : (UITextField *) textField : (int) paddingLeft : (int) paddingRight { textField.leftView = [[UIView alloc] initWithFrame: CGRectMake (0, 0, paddingLeft, 0)]; textField.rightView = [[UIView alloc] initWithFrame: CGRectMake (0, 0, paddingRight, 0)]; textField.leftViewMode = UITextFieldViewModeAlways; textField.rightViewMode = UITextFieldViewModeAlways; } #End If Call B4X: Dim no As NativeObject = Me no.RunMethod ("setInsets:::", Array (B4XFloatTextField2.TextField, 50, 75))
Gianni Sassanelli Active Member Licensed User Longtime User Aug 18, 2021 #10 Semen Matusovskiy said: 1) If B4XFloatTextField is Multiline, B4i uses a TextView. .... 2) If B4XFloatTextField is Singleline, B4i uses a TextField. ..... Click to expand... Wonderful!!! very powerful answer. this solve my issue. thank's mutch Upvote 0
Semen Matusovskiy said: 1) If B4XFloatTextField is Multiline, B4i uses a TextView. .... 2) If B4XFloatTextField is Singleline, B4i uses a TextField. ..... Click to expand... Wonderful!!! very powerful answer. this solve my issue. thank's mutch