Is it possible to create a panel in the designer containing 3 labels and 2 imageviews, and then in the app startup, add this panel 7 times to a scroll view and still be able to respond to Click, and also to change label.text for each of them?
I do this programmatically, that is I create everything at runtime and not in the designer. This way I have been able to create an array of lables and imageviews, this gives me the ability to respond to events from them, and change individual elements.
The problem is that I do not understand how to resize the controls I have created at runtime for different devices. My target device was portrait mode 600 wide Galaxy Tab 7”, but since starting the boss now has a HTC Sensation, and the screen is different, so the hardcoded layout has to change.
It was my understanding that I could create a base panel in the designer, for each screen size I wished to support, and the device would choose the best fit. But How do I reference the labels on these panels? Would I have to create 7 base panels with all labels and images, and then do the exact same for each layout variant?
Also, I currently simply add a tag value to each view I add in a panel.
e.g. first panel added is element 0, thus the labels and images added have a tag of 0 applied.
This means I can easily reference views by the index, allowing me to change text etc and respond to clicks.
I can currently change it by lblName(2).Text = “NEW NAME HERE”
I can currently respond to a longlick by
So is this possible in the designer? Or do I stick with code and try understand how to resize controls on different screens?
I do this programmatically, that is I create everything at runtime and not in the designer. This way I have been able to create an array of lables and imageviews, this gives me the ability to respond to events from them, and change individual elements.
The problem is that I do not understand how to resize the controls I have created at runtime for different devices. My target device was portrait mode 600 wide Galaxy Tab 7”, but since starting the boss now has a HTC Sensation, and the screen is different, so the hardcoded layout has to change.
It was my understanding that I could create a base panel in the designer, for each screen size I wished to support, and the device would choose the best fit. But How do I reference the labels on these panels? Would I have to create 7 base panels with all labels and images, and then do the exact same for each layout variant?
Also, I currently simply add a tag value to each view I add in a panel.
e.g. first panel added is element 0, thus the labels and images added have a tag of 0 applied.
This means I can easily reference views by the index, allowing me to change text etc and respond to clicks.
I can currently change it by lblName(2).Text = “NEW NAME HERE”
I can currently respond to a longlick by
B4X:
Sub lblName_LongClick
Dim Send As View : Send=Sender
lblName(Send.Tag).Text = lblName(Send.Tag).Text & " CLICKED! "
End Sub
So is this possible in the designer? Or do I stick with code and try understand how to resize controls on different screens?