Layout / positioning lost after saving project

Bongo

Member
Licensed User
Longtime User
Hi all,

I'm very new to B4A. I have worked through the first 2 examples in the pdf guide availalbe on here. All went well.

But today I have just spent 3 hours laying out, resizing, styling etc the components for a little app I am making in order to reinforce what i have learned so far. I saved the project and saved the layout in designer...

...However, when I reopened the project, the layout has not been saved! All the components (views i think they are called?) are there, the styling, variable names etc are all correct, but the size and position information has all been lost!

Instead of being presented with the layout that took quite a while to produce, all the parts are just plonked on top of each other and have been resized!

I definitely saved everything, but I must have done something wrong for this to have happened.

Can anybody shed some light on this for me since I don't want it to happen again!

Thanks in advance
 

BarrySumpter

Active Member
Licensed User
Longtime User
Welcome.
Sorry to read about this issue.
It's never happened to me in b4a that I recall.

Could it be the wrong copy of the project?
Or perhaps the wrong layout within the project?

I'm sure my layouts are saved automaticly
when I exit the designer or b4a ide.
And when I compile.

I could only suggest to make periodic backups of the project folder.
Make sure you have the latest version.
And a valid license.

hth and looking forward to your future posts.

p.s.
I've pretty much moved away from the designer.
And just create all the views in script.

It took me a long time to get over the fact that b4a is not
as centred around a wysiwig form design like vb6 n RB, etc.
 
Last edited:
Upvote 0

warwound

Expert
Licensed User
Longtime User
Hi.

Have you got more than one Layout Variant listed when you load your saved layout in the Designer?

It could be that you made all the changes and edits to your layout with one variant selected and when you reloaded the layout another variant was selected and your edits were not applied to that variant.

So if you have more than one Layout Variant listed click through them all and hopefully one of them will contain your saved layout.

Martin.
 

Attachments

  • layout_variants.png
    layout_variants.png
    8.8 KB · Views: 408
Upvote 0

Bongo

Member
Licensed User
Longtime User
Thanks for your replies!

BarrySumpter:
I definitely saved everything, into its specific folder for the project. Also when closing the designer, it pops up a dialogue box to prompt a save if you have made any changes since the last save, so I'm certain it was all saved.

I've pretty much moved away from the designer.
And just create all the views in script.

That sounds like something that might interest me. I'm from a HTML/PHP background so coding layout designs is something I'm used to. I wouldn't know how to do it for B4A but i'll try and find out.

warwound:
It may have something to do with the layout variant based on what you said.
I have a Galaxy Note which has a big screen (800 x 1280) so I wanted to design it with this screen in mind.

I think i set up a layout variant which was half this size, but then within the abstract designer menu I saw an option for Galaxy Note so I clicked that.
This galaxy note screen option was set to 800 x 1280 @ 320dpi but I could not see how to replicate this in the menu you attached as a screenshot. You can specify the resolution but not pixel density. Maybe it doesn't matter?

When I reopened the project I thought it would open with whatever settings I was working with when i saved the project, but it didn't.

I guess I have some learning to do about the layouts and screen sizes.

Is there any documentation you would recommend which explain this? I assumed if you created a layout for a specific screen size, that it would just automatically rescale to enlarge or reduce in size based on the screen resolution of the device running the app, but this doesn't seem to be the case?

I mean, I made the first app in the basic guide pdf, which was designed on a fairly small screen resolution. When I view the app on my Galaxy note, everything is off to the left rather than being centered.

Sorry for my rambling post, I just really want to get stuck in with B4A, but I want to make sure I understand the layouts etc so this doesn't happen again.

Thanks again for your replies.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Hi again.

If you load your layout into the Designer do more than one Layout Variants appear in the list - similar to there being 2 Layout Variants in the screenshot i posted?

If so then select them each one in turn and look to see if your layout re-appears with all edits and correct positions.

If not then something went wrong and i think you'll have to start again - sorry!

You've already found the Beginners PDF Guide so that's about it apart from of course all the forum posts - there's quite a few.

The Wiki is also a great place to spend a few hours reading, and if you want to concentrate on layouts i'd suggest this post: http://www.b4x.com/forum/basic4andr...ing-multiple-screens-tips-best-practices.html.

Martin.
 
Upvote 0

Bongo

Member
Licensed User
Longtime User
Thanks Martin.

Yes when I open it there are 2 resolutions I believe (I'm not at my laptop with B4A installed so I'm going from memory).

When I get home I'll check on the 2 resolutions. I might see if I can make a screen cast video to show what has happened and post it here, it will probably be easier to see than to make out from my descriptions of what went wrong.

I'll check out the links you suggested and do some reading.

I just wanted to dig in without referring to any documentation yesterday to reinforce the little I had learned so far. But you learn from your mistakes so I'd rather mess things up completely now than in the middle of trying to create a more complicated app!

Jason
 
Upvote 0

Bongo

Member
Licensed User
Longtime User
Just wanted to update this - Martin you were correct. I have several layouts in the designer. Even though I swear i had clicked them all before, this time upon clicking one of them, my layout magically reappeared! I fell a bit stupid now but there you go.

Thanks again.
 
Upvote 0
Top