Wish Custom View Anchors and Width/Height

LWGShane

Well-Known Member
Licensed User
Longtime User
I think the ability to set the Horizontal and Vertical Anchors and the Width and Height of the view that's created in the designer would be helpful to us who are creating wrappers of controls.
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
You can set anchors on the Base pane of the custom view, as the base pane can contain many views it is up to the developer to control the content in the Base_Resize sub. Or with a layout loaded into the Base.

If you have wrapped a view and only want to control that, it's as simple as:
B4X:
Sub Base_Resize(Width As Double,Height As Double)
    MyView.PrefWidth = Width
    MyView.PrefHeight = Height
End Sub

Or it's JavaObject equivalent.
 

LWGShane

Well-Known Member
Licensed User
Longtime User
@stevel05, @Erel - Sorry, I should have been more clear: I'm talking about setting default width and height the pane that appears in the designer along with the horizontal/vertical anchors. (See attached screenshot.) Currently, the default width and height is 100px and the default Horizontal and Vertical anchor is Top and Left.
 

Attachments

  • CustomView.PNG
    CustomView.PNG
    26.5 KB · Views: 243
Top