I have a problem app with buttons not hidden. I have a panel set to Elevation of two, some buttons are hidden some are not.
Buttons that I operate immediately before the panel is brought to the front are not hidden.
If I set the panel elevation higher than two the labels on the panel are hidden.
Attached is a mock-up example that demonstrates the problem. [The real app too big.]
In the example the button Const brings PnlView to the front and a listview is built on it. Three buttons and labels are hidden but the Const button is not hidden
The buttons are parented by the activity.
Sorry about the example being so large but I built it to trace a number of issues
the screenshot shows a panel created like this: BigImgsViewerPnl.Initialize("BigImgsViewerPnl") BigImgsViewerPnl.LoadLayout("ImgsViewLy") BigImgsViewerPnl.Visible=False BigImgsViewerPnl.Enabled=False Activity.AddView(BigImgsViewerPnl,0,0,100%x,100%y) by a button click it become...
As I said in the original post, " If I set the panel elevation higher than two the labels on the panel are hidden. ". If I did that I would be swapping one problem for another.
There are several ways to get around this as suggested by johnC and my reply above. It still leaves a mystery, why are some buttons hidden and others not?
I thought I had done something wrong, but if you don't know the answer it's probably unanswerable.
I will look at grouping all views on respective panels. [I see a headache coming on.]
Once the elevation is the same, the visibility depends on the views order.
There are many mistakes in the way the layout is built.
1. You should really learn how to use anchors. This will allow you to remove most of the designer script code.
2. Instead of calling BringToFront / SendToBack you should change the elevation as it precedes the views order.
Once the elevation is the same, the visibility depends on the views order.
There are many mistakes in the way the layout is built.
1. You should really learn how to use anchors. This will allow you to remove most of the designer script code.
2. Instead of calling BringToFront / SendToBack you should change the elevation as it precedes the views order.
Erel,
Let's not get in to an argument, but your first sentence Re: the elevation being the same leaves
visibility a function of Z order is what is not happening.
Yes, many errors can be made. Please, in the example what error have I made that causes the program not to behave in the way expected.
Regards Roger
PS
1. Off subject, but I will read up on anchors.
2. I understood that "Panel" was the only view with an Elevation member. I can't recall seeing this method used in the B4A examples.
Changing the elevation does the trick. The mistake I was making was setting the Elevation in the designer above 2 and leaving it. This is what is advised in many answers to forum questions on this issue. I found nothing suggesting changing the elevation, but we get there in the end.
In searching for an answer/cause I came across a couple of comments that implied that the button shadow/animation can leave a button with an effective elevation of 2+.
There was no clear statement but this is what I inferred. This fits with what I was finding, [the buttons that had been recently operated were the buttons that showed through panel.]
Sorry about the messy code [Circa 2017] but I do so little programming my skills are 2016 beginners level. For example I had to look up B4XDialog.
You've convinced me I'm stuck in the 1994-1996 beginners guide. I've downloaded the booklets, pushed the reset button on my B4A knowledge and starting again as if I have never seen B4A. ?