Android Question The size and position with setlayout

Isac

Active Member
Licensed User
Longtime User
Hello,
I changed the position of the buttons with setLayout () on the cell S3,
but when I load the same program on a cellualre with lower resolutions, the buttons remain the same size, but the text inside the buttons is almost canceled.
Do you have any idea?

thanks
 
I have included the log

Code: Copy
    TextScale = GetDeviceLayoutValues.ApproximateScreenSize/2
    lbltopright.Textsize = 3.14* TextScale
    Log(lbltopright)
    Log("Textscale="& TextScale)

(EditText): Layout not available, Text=
Textscale=1

I'm using a galxy next
 

Attachments

  • button.jpg
    button.jpg
    12.7 KB · Views: 341
Upvote 0
Post your complete code !!!!
We are turning in circle !
Code: Copy
TextScale = GetDeviceLayoutValues.ApproximateScreenSize/2
    lbltopright.Textsize = 3.14* TextScale
This has nothing to do with what I posted !
If you don't want to help us helping you what do you expect.
 
Upvote 0
Thank you all for your patience I finally solved

Code: Copy
    TextScale = GetDeviceLayoutValues.ApproximateScreenSize / 0.5
    btnAvvisami.Textsize = 3.14 * TextScale
    Label1.TextSize= 2.95* TextScale
    Label2.TextSize= 3.14 * TextScale
    btnData.TextSize= 3.14 * TextScale
    btnCancella.TextSize= 3.14 * TextScale
    edGiorni.TextSize= 2.1 * TextScale
 
  • Like
Reactions: eps
Upvote 0
Also take care with the gravity of the button text as well - this will have an impact on how it is displayed on the button.
 
Upvote 0
Sorry, but this looks very strange to me.
With
Label1.TextSize= 2.95* TextScale
Label2.TextSize= 3.14 * TextScale

Two different text size adjustments for labels is strange ?
This means that the original height and / or text size are not coherent.
There can be different reasons, but without knowing what you are doing it's difficult to give any advice.
- Do you have AutoScale active in the Designer ?
- What are the backgrounds of the different views ?
- The padding can be different for different views.
etc.
 
Upvote 0
Yes, because they also have different setLayout
Currently it works on both devices correctly.
thanks :)
 
Upvote 0
Back
Top