Hi ive just started using App Inventor and i have an issue with the screen size of my app. On my title page I have a label with the text being the name of my game which being size 22 font it fits perfectly along the width of the screen (im using portrait only for the app) on 1 line. Now when i view it on my JXD 7800b android tablet device - portrait way, up the text extends to a 2nd line as if the screen width of the JXD 7800b im using is much smaller then what is showing on the viewer. is this common that some devices are not correctly set up for App Inventor.
I have a background image for the title page and this image is 320x420 and seems to fit perfect so why is the text so way off?
Thanks for any help
--
Try scaling FontSize to a percentage of screen Width or Height.
A font size of 22 on a phone will look tiny on a tablet.
First, set the screen Sizing to Responsive.
Then set the font size to a percent of the screen height:
set MyText.FontSize to 0.05 * Screen1.Height
The text will now scale to the same proportional size on different screens.
Also, the Designer layout is a very rough approximation of what the screen on the device will look like.
You must use the device and the Companion app to see what it will actually look like.
--
Ok tried that but there was no difference, the text was the same as it was before and when i set screen sizing to responsive then the text was the same but all my buttons i have on the screen shrunk massively and moved to the left hand side of the screen (with use of the table arrangement i had them centered both from left to right and from the label i have trouble with to the bottom of the screen). When you say size 22 font will be tiny on a tablet well thats the thing, its not tiny, the text is only a total of 21 characters including spaces and it does not fit cause its too big, bigger then it shows on the viewer yet the buttons dont seem bigger on my JXD tablet then it does on the viewer.
--
I guess what i need to do generally is ensure all text is set to a percentage of screen size to ensure it fits correctly to all screens and also dont use the viewer as a guide to how it will look but to connect to my mobile device when creating a screen to see how it will look.
--
Yes. Most visible components have a PercentWidth and PercentHeight property.
I recommend using those rather than Width and Height properties.
--
I believe that fully responsive text sizing (that uses dp instead of pixels or %) is yet implemented in AI2. One way I have used is to select a size that will not overflow on small devices but is still readable on tablets - something between 15-21 for text or 25-30 for headings. Since devices have pixel different densities setting text to percentage of screen can tricky.
--
댓글 없음:
댓글 쓰기