Android Question Making Customview as a parent

azzam223

Active Member
Licensed User
Longtime User
hello Can I make custom view as parent like panel So I can Add views to it in designer
 

stevel05

Expert
Licensed User
Longtime User
Load the layout into the mBase Panel variable.
 
Upvote 0

azzam223

Active Member
Licensed User
Longtime User
thanks steve but How Can I Know the target layout I want when Add controls to the designer I can put it in my custom view
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
A custom view would normally only have one layout so you would do it the same as loading any other layout:
B4X:
mBase.LoadLayout("LayoutName")

I think you are suggesting that you want to load different layouts into the same custom view dependant on some user interaction. If that is the case, I wouldn't, as it will mean handling the events from views from multiple layouts in one class. I would create multiple custom views, then load and remove those from a panel or create a new activity for each, It really depends on what you are trying to achieve.
 
Upvote 0

azzam223

Active Member
Licensed User
Longtime User
thanks erel this mean that IF I want To add views to my custom I must put it in another layout then load this layout or load the same layout that my custom view in it

is any way to add it in designer instead of load it in run time
 
Upvote 0

azzam223

Active Member
Licensed User
Longtime User
I mean I want my custom view like panel So when i add view I can put the view in my custom view like panel through parent property
 
Last edited:
Upvote 0
Top