Android Question Layout not fitting well on some devices

ProjectGroup19

Active Member
Licensed User
I created this layout which fitted perfectly on my phone which has a larger screen but not fitting well on other phones.
 

Attachments

  • login.bal
    15.7 KB · Views: 113

ProjectGroup19

Active Member
Licensed User
Screenshot_20200404-141004.png


The size is 2.72mb
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
First, when you post a project as a zip file you should export it directly from the IDE, this will limit the size:

1586011181000.png


In your zip file the LOGIN.jpg file and another one are missing.

Attached you find the modified project.

That's how it looks on my 10'' tablet and my phone.

1586013333409.png
1586013344669.png
 
Upvote 0

ProjectGroup19

Active Member
Licensed User
The LOGIN.jpg is no longer used. It was formerly the background before I changed it to the current one.

Screenshot_20200404-152654.png

This is mine.
This is what I was taking about. it's appearing different on your device.
The Login and Create Account are not showing in yours. They are within the same panel as USERNAME.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Yes, I was missing two views, sorry, I didn't notice it because they are hidden in your layout.

Do you want your application on any device, tablet and phone?
With your layout, it will be difficult to fit in a 4.5 '' screen.

Did you have a look on the project I posted?
It might inspire you to adapt the layout to your needs.

PS. When you add images in the forum, please reduce their size.
Do you know that you can take screenshots directly in the IDE, if you are connected via USB?
Did you have a look at the B4X Visual Designer Booklet?
 
Upvote 0

ProjectGroup19

Active Member
Licensed User
I have read the book but I will consider reading it again maybe there is something I'm missing.
Thank Klaus:)
I really appreciate your effort.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Well, layout design is very suptile in B4A.
You have devices from screen sizes of about 4'' up to 10''.
Then, you need to define what you want to display at the same time on a same screen.
Do you want to show the same layout, designed for a 4'' screen stretched to fit in a 10'' screen ?
Probably no, for me it's none sense!
So you need to define the usage of your application, for phones and tablets or only phones or only tablets.
Depending on this. the layout design will, could, be different!
So, YOU need to decide what YOU want to display at the same time on one screen for given devices !?
It's a simple phrase, but all the difficulty is here.

Just as an example, I had written, quite some time ago, an application to read mp3 files, a juke box, not published.
The first application was for a friend of mine having a tablet.
So, I designed a layout for tablet and all was fine.
But, then I thought, it would be interesting for me to have it also on my phone.
So, I wrote an application for phones.
But, maintaining two applications with almost 80 to 90% of same code is crazy.
So, I merged both applications into one, but, defining different layouts for phones and tablets working with one Activity and Panels.
On phones, I display one Panel in portrait orientation and on tablets I display two Panels side by side in landscape orientation with small adaptations.
It needed quite some adaptations for the Panel management, but at the end it works fine for about 5 years now.
And finally, I used it more on the phone instead of a tablet.
Sorry for the 'long' story, but it illustrates the problem.
 
Last edited:
Upvote 0
Top