I expect this to show the title pushed up to the left and the date pushed up to the right on the same line but it crops off the last digit of the year 29/09/201 instead of 29/09/2014 and when the orientation changes to portrait it crops of the last tow year digits.. I have a Samsung Galaxy Tab S..
Works fine for me. Samsung Galaxy S3. Where do you have the labels' left defined? If you have Label2.Left = 50%x and Label2.Width = 100%x, half the label will extend past the right edge of the screen. Try something like this.
Label1.TextSize = 1.5%x
You should not set the TextSize proportional to the width of the screen !
With your code the size of the text is different depending on the screen orientation !?
You shouldn't either set values depending on the screen density, TextSize is density independant !
Works fine for me. Samsung Galaxy S3. Where do you have the labels' left defined? If you have Label2.Left = 50%x and Label2.Width = 100%x, half the label will extend past the right edge of the screen. Try something like this.
It was the 'left' definition.. I had placed them on the designer on the left but I guess it wasn't at 0.. I added the Left = 0%x and it shows as expected.. Many thanks for your observations..
Label1.TextSize = 1.5%x
You should not set the TextSize proportional to the width of the screen !
With your code the size of the text is different depending on the screen orientation !?
You shouldn't either set values depending on the screen density, TextSize is density independant !
That's exactly what I was looking for. When the use turns the device I wanted it to show the text size a bit bigger as the use would only turn it because they couldn't read the text the size it was portrait.. Only a few controls will show like that but I do take on board your comments as I am only new and need all the help and advice I can get
You must also make sure that the Label.Height is height enough to not crop the text verticaly.
Again, this Label1.TextSize = 1.5%x will not work properly on different screen densities.
On a screen with a size of 3.5' and a width of 320 pixels and density 1 you get a font size of 4.8.
On a screen with a size of 3.5' and a width of 480 pixels and density 1.5 you get a font size of 7.2, but the pysical sceen size remains the same !
Do you really want this ?
This will work Label1.TextSize = 1.5%x / GetDeviceLayoutValues.Scale.
I am lucky with this project as the users have chosen one device and are not using any other. Once this project is complete though your suggestions will be very much what I need to incorporate into my apps..