S Saeed Qatari Member Licensed User Sep 17, 2020 #1 Please let me know how to set the margins of a button text with an example.
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2020 #2 What exactly are you trying to do? The text appears in the center. Upvote 0
S Saeed Qatari Member Licensed User Sep 17, 2020 #3 Yes, it is by default the text aligned in the center. I have aligned the text to the left and appears without a margin, so I am trying to add a margin to the left and also to the right with a multiline set to true. Upvote 0
Yes, it is by default the text aligned in the center. I have aligned the text to the left and appears without a margin, so I am trying to add a margin to the left and also to the right with a multiline set to true.
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2020 #4 Not so simple. It will be simpler to put a label inside a panel. It will look the same. Upvote 0
S Saeed Qatari Member Licensed User Sep 17, 2020 #5 Agree and will do that change. Thank you... Upvote 0
Semen Matusovskiy Well-Known Member Licensed User Sep 17, 2020 #6 Actually, not very difficult. For example, left-top aligned multiline text B4X: Dim no As NativeObject no = Button1 no.GetField ("titleLabel").SetField ("lineBreakMode", 0) ' WordWrap no.SetField ("contentHorizontalAlignment", 1) ' Left no.SetField ("contentVerticalAlignment", 1) ' Top no.RunMethod ("setContentEdgeInsets:", Array (no.MakeEdgeInsets (50, 20, 50, 20))) Upvote 0
Actually, not very difficult. For example, left-top aligned multiline text B4X: Dim no As NativeObject no = Button1 no.GetField ("titleLabel").SetField ("lineBreakMode", 0) ' WordWrap no.SetField ("contentHorizontalAlignment", 1) ' Left no.SetField ("contentVerticalAlignment", 1) ' Top no.RunMethod ("setContentEdgeInsets:", Array (no.MakeEdgeInsets (50, 20, 50, 20)))