Emme Developer Well-Known Member Licensed User Longtime User Aug 1, 2017 #1 Hi! When create a new custom view, there is this sub Code: Copy Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) mBase = Base End Sub That can be used to adjust size of view. But this subs is called only when view is added using designer. there is a way to call a sub like this when a view is added programmatically? I want to do something like Pnl.Addview(customview) as happens with all other base android view, without doing a properly method. Is possible? I hope i clearly explain. Thanks!
Hi! When create a new custom view, there is this sub Code: Copy Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) mBase = Base End Sub That can be used to adjust size of view. But this subs is called only when view is added using designer. there is a way to call a sub like this when a view is added programmatically? I want to do something like Pnl.Addview(customview) as happens with all other base android view, without doing a properly method. Is possible? I hope i clearly explain. Thanks!
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2017 #2 Most custom views (at least the ones I wrote) can only be added with the designer. If a developer wants to create the layout programmatically then he can create a layout file with the custom view and load it whenever needed. Upvote 0
Most custom views (at least the ones I wrote) can only be added with the designer. If a developer wants to create the layout programmatically then he can create a layout file with the custom view and load it whenever needed.
Emme Developer Well-Known Member Licensed User Longtime User Aug 1, 2017 #3 Erel said: Most custom views (at least the ones I wrote) can only be added with the designer. If a developer wants to create the layout programmatically then he can create a layout file with the custom view and load it whenever needed. Click to expand... I know this, but i ask the question because i want to share a list of custom view. For others developer i think is "busy/difficult" to add all them in a layout and load it when they need Upvote 0
Erel said: Most custom views (at least the ones I wrote) can only be added with the designer. If a developer wants to create the layout programmatically then he can create a layout file with the custom view and load it whenever needed. Click to expand... I know this, but i ask the question because i want to share a list of custom view. For others developer i think is "busy/difficult" to add all them in a layout and load it when they need
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2017 #4 Emme Developer said: but i ask the question because i want to share a list of custom view Click to expand... Not sure that I understand. Anyway you can add a different sub that creates a "base" panel. Upvote 0
Emme Developer said: but i ask the question because i want to share a list of custom view Click to expand... Not sure that I understand. Anyway you can add a different sub that creates a "base" panel.
Emme Developer Well-Known Member Licensed User Longtime User Aug 1, 2017 #5 Erel said: Not sure that I understand Click to expand... I want to share more than one CustomView, but there are all in same projects. I mean this Erel said: Anyway you can add a different sub that creates a "base" panel. Click to expand... Thanks i will try Upvote 0
Erel said: Not sure that I understand Click to expand... I want to share more than one CustomView, but there are all in same projects. I mean this Erel said: Anyway you can add a different sub that creates a "base" panel. Click to expand... Thanks i will try
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2017 #6 Emme Developer said: I want to share more than one CustomView, but there are all in same projects Click to expand... It doesn't matter. Upvote 0
Emme Developer said: I want to share more than one CustomView, but there are all in same projects Click to expand... It doesn't matter.
klaus Expert Licensed User Longtime User Aug 1, 2017 #7 You may have a look at chapter 4.2 Adding a custom view by code in the B4x CustomView booklet. Link in my signature. Upvote 0
You may have a look at chapter 4.2 Adding a custom view by code in the B4x CustomView booklet. Link in my signature.
Emme Developer Well-Known Member Licensed User Longtime User Aug 1, 2017 #8 klaus said: You may have a look at chapter 4.2 Adding a custom view by code in the B4x CustomView booklet. Link in my signature. Click to expand... Many thanks Klaus, i didn't see that booklet. I must to read it! Upvote 0
klaus said: You may have a look at chapter 4.2 Adding a custom view by code in the B4x CustomView booklet. Link in my signature. Click to expand... Many thanks Klaus, i didn't see that booklet. I must to read it!