C clooney48 Active Member Licensed User Longtime User Nov 14, 2013 #1 Strange problem! I have a layout with two rows of buttons at the bottom. The last row (4 buttons) works without problems but the large button "btnLatLon" with the label "Label5" on top works only after tapping x times on the screen, especially at the bottom of the button there is a chance, so that I hit the buttons below also. I hope this was understandable. Enclosed the layout and the layout definitions. Of course the button btnLatLon is defined and there is a "Sub btnLatLon_Click" in the code. (The buttons are imageviews with a label on top). When i remove all the layout code the two rows of buttons are in the middle and not button works. Code: Copy 'All variants script 'AutoScaleAll 'uncomment to scale all views based on the device physical size. AutoScaleRate(0.5) LVDb.Width = 100%x LVDb.SetTopAndBottom(lblBalken.Bottom, btnLatLon.Top - 10dip) lblBalken.Width = 100%x lblPOI.Left = 5%x lblDist.Right = 95%x btnByNumber.Width = 23%x btnByNumber.Left = 0%x btnByNumber.Bottom = 99%y Label1.Bottom = 99%y btnByName.Width = 23%x btnByName.Left = btnByNumber.Right + 10dip btnByName.Bottom = 99%y Label2.Left = btnByNumber.Right + 10dip Label2.Bottom = 99%y btnByMls.Width = 23%x btnByMls.Left = btnByName.Right + 10dip btnByMls.Bottom = 99%y Label3.Left = btnByName.Right + 10dip Label3.Bottom = 99%y btnSearch.Width = 23%x btnSearch.Left = btnByMls.Right + 10dip btnSearch.Bottom = 99%y Label4.Left = btnByMls.Right + 10dip Label4.Bottom = 99%y btnLatLon.Left = 0%x btnLatLon.Width = 100%x btnLatLon.Bottom = btnByName.Top - 10dip Label5.Left = 0%x Label5.Width = 100%x Label5.Bottom = btnByName.Top - 10dip Attachments screenshot.png 16.4 KB · Views: 448
Strange problem! I have a layout with two rows of buttons at the bottom. The last row (4 buttons) works without problems but the large button "btnLatLon" with the label "Label5" on top works only after tapping x times on the screen, especially at the bottom of the button there is a chance, so that I hit the buttons below also. I hope this was understandable. Enclosed the layout and the layout definitions. Of course the button btnLatLon is defined and there is a "Sub btnLatLon_Click" in the code. (The buttons are imageviews with a label on top). When i remove all the layout code the two rows of buttons are in the middle and not button works. Code: Copy 'All variants script 'AutoScaleAll 'uncomment to scale all views based on the device physical size. AutoScaleRate(0.5) LVDb.Width = 100%x LVDb.SetTopAndBottom(lblBalken.Bottom, btnLatLon.Top - 10dip) lblBalken.Width = 100%x lblPOI.Left = 5%x lblDist.Right = 95%x btnByNumber.Width = 23%x btnByNumber.Left = 0%x btnByNumber.Bottom = 99%y Label1.Bottom = 99%y btnByName.Width = 23%x btnByName.Left = btnByNumber.Right + 10dip btnByName.Bottom = 99%y Label2.Left = btnByNumber.Right + 10dip Label2.Bottom = 99%y btnByMls.Width = 23%x btnByMls.Left = btnByName.Right + 10dip btnByMls.Bottom = 99%y Label3.Left = btnByName.Right + 10dip Label3.Bottom = 99%y btnSearch.Width = 23%x btnSearch.Left = btnByMls.Right + 10dip btnSearch.Bottom = 99%y Label4.Left = btnByMls.Right + 10dip Label4.Bottom = 99%y btnLatLon.Left = 0%x btnLatLon.Width = 100%x btnLatLon.Bottom = btnByName.Top - 10dip Label5.Left = 0%x Label5.Width = 100%x Label5.Bottom = btnByName.Top - 10dip
NJDude Expert Licensed User Longtime User Nov 14, 2013 #2 You should include your project to better understand what's going on. By looking at your screenshot, it seems the label might be blocking the imageview, but that's just a guess. Last edited: Nov 15, 2013 Upvote 0
You should include your project to better understand what's going on. By looking at your screenshot, it seems the label might be blocking the imageview, but that's just a guess.
eps Expert Licensed User Longtime User Nov 14, 2013 #3 Personally I would generate this with debug and trace through the code to see exactly what's going on. Upvote 0
Personally I would generate this with debug and trace through the code to see exactly what's going on.
C clooney48 Active Member Licensed User Longtime User Nov 14, 2013 #4 NJDude said: You should include you project to better understand what's going on. By looking at your screenshot, it seems the label might be blocking the imageview, but that's just a guess. Click to expand... I supposed this too although the 4 buttons below worked nevertheless there were also labels on it. But I tested this inserting a new sub procedure "Sub Label5_Click". This worked neither. Upvote 0
NJDude said: You should include you project to better understand what's going on. By looking at your screenshot, it seems the label might be blocking the imageview, but that's just a guess. Click to expand... I supposed this too although the 4 buttons below worked nevertheless there were also labels on it. But I tested this inserting a new sub procedure "Sub Label5_Click". This worked neither.
Erel B4X founder Staff member Licensed User Longtime User Nov 15, 2013 #5 Can you upload your project (File - Export as zip)? Upvote 0
C clooney48 Active Member Licensed User Longtime User Nov 15, 2013 #6 You were right! I had in the code additionally to the designer code this line: "Activity.AddView(LVDb, 0, 150, 95%x, 80%y)". This caused that the button was covered for 90%. Thanks! Upvote 0
You were right! I had in the code additionally to the designer code this line: "Activity.AddView(LVDb, 0, 150, 95%x, 80%y)". This caused that the button was covered for 90%. Thanks!
NJDude Expert Licensed User Longtime User Nov 15, 2013 #7 You should use DIP: Good: Code: Copy Activity.AddView(LVDb, 0dip, 150dip, 95%x, 80%y) Bad: Code: Copy Activity.AddView(LVDb, 0, 150, 95%x, 80%y) Not using dip will make your layouts not to scale properly on all devices. Upvote 0
You should use DIP: Good: Code: Copy Activity.AddView(LVDb, 0dip, 150dip, 95%x, 80%y) Bad: Code: Copy Activity.AddView(LVDb, 0, 150, 95%x, 80%y) Not using dip will make your layouts not to scale properly on all devices.