azzam223 Active Member Licensed User Longtime User Sep 10, 2017 #1 hello Can I make custom view as parent like panel So I can Add views to it in designer
Eme Fibonacci Well-Known Member Licensed User Longtime User Sep 10, 2017 #2 No. You can't do it. However, you can load a layout at runtime to customview. Upvote 0
stevel05 Expert Licensed User Longtime User Sep 10, 2017 #3 Load the layout into the mBase Panel variable. Upvote 0
azzam223 Active Member Licensed User Longtime User Sep 11, 2017 #4 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
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
stevel05 Expert Licensed User Longtime User Sep 11, 2017 #5 A custom view would normally only have one layout so you would do it the same as loading any other layout: Code: Copy 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
A custom view would normally only have one layout so you would do it the same as loading any other layout: Code: Copy 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.
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2017 #6 Note that you can't load a layout from DesignerCreateView directly. You can add Sleep(0) before calling LoadLayout and it will work. Upvote 0
Note that you can't load a layout from DesignerCreateView directly. You can add Sleep(0) before calling LoadLayout and it will work.
azzam223 Active Member Licensed User Longtime User Sep 12, 2017 #7 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
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
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2017 #8 I'm not sure that I understand the question. Example of custom view that loads a layout: https://www.b4x.com/android/forum/threads/27548/#content Upvote 0
I'm not sure that I understand the question. Example of custom view that loads a layout: https://www.b4x.com/android/forum/threads/27548/#content
azzam223 Active Member Licensed User Longtime User Sep 12, 2017 #9 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: Sep 12, 2017 Upvote 0
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
Erel B4X founder Staff member Licensed User Longtime User Sep 13, 2017 #10 It is not possible. Provide a LoadLayout method instead. Upvote 0