B4J Question VBox & TextField Issue

Discussion in 'B4J Questions' started by ShaneG30, May 27, 2018.

  1. ShaneG30

    ShaneG30 Well-Known Member Licensed User

    I'm creating a wrapper for VBox and HBox (along with LinearLayout and UIStackView). I've completed VBox however, I have an issue with the TextField control: When I add one to the VBox, the VBox ignores its "PrefWidth" property.

    I'm creating the wrappers instead of using the designer because this gives me more control over the UI and how/when it's generated.

    Project is attached.
     

    Attached Files:

  2. Daestrum

    Daestrum Well-Known Member Licensed User

    I believe the width of the Vbox is dependant on the width of the items you add to it.
    You can set the minimum and maximum width of the Vbox, and set whether the items take up the full width of the Vbox (providing they are resizable).
     
    ShaneG30 likes this.
  3. ShaneG30

    ShaneG30 Well-Known Member Licensed User

    @Daestrum - Thanks; looking at code examples, I solved it by calling VBox.setFillWidth(bool).
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice