B Bernd68 Member Licensed User Longtime User Apr 4, 2012 #1 Hi all, i have 2 problems with the Background of Label and Panel. 1. I set the Background with a GradientDrawable which is a nice effect. But now using 4 Panels, 1 "visible = true" and 3 "visible = false", i have seen, that, after setting a panel which was "visible = true" to "visible = false" and back in to "visible = true", the GradientDrawables used as Background resizes itsself !? 2nd. I can't scroll down to the end of the ScrollView. Maybe there is a bug in my code? I've have attached two screenshots where you can see this effect, and also the project which i hope someone could review. To reproduce this with the example attached After clicking start on the first panel, you choose a book on the second panel and on the third panel you press the top right symbol 2 twice. Thx for you help Attachments gdraw_initial.png 46.3 KB · Views: 681 gdraw_lost.png 45.5 KB · Views: 675 booksample.zip booksample.zip 26 KB · Views: 469 Last edited: Apr 4, 2012
Hi all, i have 2 problems with the Background of Label and Panel. 1. I set the Background with a GradientDrawable which is a nice effect. But now using 4 Panels, 1 "visible = true" and 3 "visible = false", i have seen, that, after setting a panel which was "visible = true" to "visible = false" and back in to "visible = true", the GradientDrawables used as Background resizes itsself !? 2nd. I can't scroll down to the end of the ScrollView. Maybe there is a bug in my code? I've have attached two screenshots where you can see this effect, and also the project which i hope someone could review. To reproduce this with the example attached After clicking start on the first panel, you choose a book on the second panel and on the third panel you press the top right symbol 2 twice. Thx for you help
A admac231 Active Member Licensed User Longtime User Apr 4, 2012 #2 1. I can't tell you why this happens but if you move this: Code: Copy lblBooksName.Background = gradBack lblBooksName2.Background = gradBack pnlivList.Background = gradBack pnlivOne.Background = gradBack lbl.Background = gradBack from pnlivOne_click to Activity_Create (under 'Build_Book_List' line #86) and remove it completely from pnlivList_click it solves the problem. 2. The panel that contains the scrollview (pnlBookList) has 100%y height. So when you use this line (#85): Code: Copy pnlBookList.AddView(scvSt,0,62,pnlBookList.Height-62,100%y) You are setting the scrollview to be 100%y of the panel. Which would be fine except its Top is 62. So the bottom of the scrollview is effectively 100%y+62. So 62 pixels will be cut off. You can fix that by either changing the scrollview height to 100%y-62 or - the better option - setting pnlBookList top to 62. I say this is better because it will make it much, much easier to edit and/or add later on. Actually, I would recommend you do that with the other panels as well. Upvote 0
1. I can't tell you why this happens but if you move this: Code: Copy lblBooksName.Background = gradBack lblBooksName2.Background = gradBack pnlivList.Background = gradBack pnlivOne.Background = gradBack lbl.Background = gradBack from pnlivOne_click to Activity_Create (under 'Build_Book_List' line #86) and remove it completely from pnlivList_click it solves the problem. 2. The panel that contains the scrollview (pnlBookList) has 100%y height. So when you use this line (#85): Code: Copy pnlBookList.AddView(scvSt,0,62,pnlBookList.Height-62,100%y) You are setting the scrollview to be 100%y of the panel. Which would be fine except its Top is 62. So the bottom of the scrollview is effectively 100%y+62. So 62 pixels will be cut off. You can fix that by either changing the scrollview height to 100%y-62 or - the better option - setting pnlBookList top to 62. I say this is better because it will make it much, much easier to edit and/or add later on. Actually, I would recommend you do that with the other panels as well.
B Bernd68 Member Licensed User Longtime User Apr 4, 2012 #3 Corner radius gets Lost Hi admac 231, i followed your advice and it solved the original problem posted. Thanks for looking into it. But now the corner radius on the top elements gets lost on the top right, left bottom and right bottom. Still very strange behaviour. I have attached 2 screenshoots where you can see it. Anyone an idea, how to solve it? :sign0163: Attachments corner_rad.png 22.7 KB · Views: 566 corner_rad_lost.png 22.7 KB · Views: 576 Upvote 0
Corner radius gets Lost Hi admac 231, i followed your advice and it solved the original problem posted. Thanks for looking into it. But now the corner radius on the top elements gets lost on the top right, left bottom and right bottom. Still very strange behaviour. I have attached 2 screenshoots where you can see it. Anyone an idea, how to solve it? :sign0163:
Erel B4X founder Staff member Licensed User Longtime User Apr 4, 2012 #4 The views are probably too large. You should always use 'dip' units when setting sizes. It will be easier to build this layout with a designer script. Upvote 0
The views are probably too large. You should always use 'dip' units when setting sizes. It will be easier to build this layout with a designer script.
klaus Expert Licensed User Longtime User Apr 4, 2012 #5 Here you are, attached a modified version. You must define at least one different GradientDrawble for each View with a different size. Otherwise all views point to the same object and if you set it to a view it will change in all the other views. That's the reason why in some cases you got small backgrounds and also why you lost the rounded corners. In the pnlivList_click and pnlivOne_click routines you should remove all the Background settings no need. Best regards. Attachments booksample1.zip booksample1.zip 26 KB · Views: 498 Upvote 0
Here you are, attached a modified version. You must define at least one different GradientDrawble for each View with a different size. Otherwise all views point to the same object and if you set it to a view it will change in all the other views. That's the reason why in some cases you got small backgrounds and also why you lost the rounded corners. In the pnlivList_click and pnlivOne_click routines you should remove all the Background settings no need. Best regards.