Douglas Farias Expert Licensed User Longtime User Apr 23, 2014 #1 how the best way to make a label auto ajustable? i make a app on my tablet example in my tablet i see Douglas Farias - São Leopoldo IN MY SMARTPHONE I SEE Douglas Farias - Sã how can i ajust only a labels for show 100% in a label not on custom view? Last edited: Apr 23, 2014
how the best way to make a label auto ajustable? i make a app on my tablet example in my tablet i see Douglas Farias - São Leopoldo IN MY SMARTPHONE I SEE Douglas Farias - Sã how can i ajust only a labels for show 100% in a label not on custom view?
stevel05 Expert Licensed User Longtime User Apr 23, 2014 #2 Use the android constant WRAP_CONTENT value which is -2. FILL_PARENT value is -1. You wont see the results in the designer if you use it, but when you run the app it will make the label just big enough to show the content. You can use it for width and height. Last edited: Apr 23, 2014 Upvote 0
Use the android constant WRAP_CONTENT value which is -2. FILL_PARENT value is -1. You wont see the results in the designer if you use it, but when you run the app it will make the label just big enough to show the content. You can use it for width and height.
Douglas Farias Expert Licensed User Longtime User Apr 23, 2014 #3 an example form a simple label with a long text? i m want only width 100% *-* width is my problem =( Upvote 0
stevel05 Expert Licensed User Longtime User Apr 23, 2014 #4 In the designer set the width to -2 If you are adding by code then it's: Code: Copy Dim L As Label L.Initialize("") L.Color = Colors.Gray L.Text = "Test of background label sizing" L.TextColor = Colors.White Activity.AddView(L,10Dip,100Dip,-2,30Dip) Upvote 0
In the designer set the width to -2 If you are adding by code then it's: Code: Copy Dim L As Label L.Initialize("") L.Color = Colors.Gray L.Text = "Test of background label sizing" L.TextColor = Colors.White Activity.AddView(L,10Dip,100Dip,-2,30Dip)
Douglas Farias Expert Licensed User Longtime User Apr 23, 2014 #6 stevel05 it possible make this on design menu? i make all my app using SetLeftAndRight SetTopAndBottom for dont need add this what can i make in my code? Activity.AddView(L,10Dip,100Dip,-2,30Dip) nomecustom.SetLeftAndRight(45%x, 90%x) nomecustom.SetTopAndBottom(22%y, 26%y) Attachments Sem título.jpg 352 KB · Views: 305 Upvote 0
stevel05 it possible make this on design menu? i make all my app using SetLeftAndRight SetTopAndBottom for dont need add this what can i make in my code? Activity.AddView(L,10Dip,100Dip,-2,30Dip) nomecustom.SetLeftAndRight(45%x, 90%x) nomecustom.SetTopAndBottom(22%y, 26%y)
stevel05 Expert Licensed User Longtime User Apr 23, 2014 #7 In the designer scripts you would set the left position, then set the width to -2: Code: Copy Label1.Left = 45%x Label1.Width = -2 Upvote 0
In the designer scripts you would set the left position, then set the width to -2: Code: Copy Label1.Left = 45%x Label1.Width = -2