Giter Club home page Giter Club logo

Comments (3)

shuilan0066 avatar shuilan0066 commented on May 18, 2024 2

height="auto"试试

from nim_duilib_framework.

nmgwddj avatar nmgwddj commented on May 18, 2024

@wizcpp 如 @shuilan0066 所述,您可以给控件高度设置 auto 属性,让控件根据子控件自动计算位置。如果 @shuilan0066 的回答有帮助您解决问题,请主动关闭 issue,谢谢。

<VBox bkcolor="bk_wnd_darkcolor">
  <VBox height="auto" bkcolor="lightcolor">
    <Button class="btn_global_blue_80x30" text="TestButton"/>
  </VBox>
  <VBox bkcolor="dark_gray">
  </VBox>
</VBox>

from nim_duilib_framework.

01haike avatar 01haike commented on May 18, 2024

@wizcpp 如 @shuilan0066 所述,您可以给控件高度设置 auto 属性,让控件根据子控件自动计算位置。如果 @shuilan0066 的回答有帮助您解决问题,请主动关闭 issue,谢谢。

<VBox bkcolor="bk_wnd_darkcolor">
  <VBox height="auto" bkcolor="lightcolor">
    <Button class="btn_global_blue_80x30" text="TestButton"/>
  </VBox>
  <VBox bkcolor="dark_gray">
  </VBox>
</VBox>

试了下,可以解决。谢谢二位@shuilan0066 @nmgwddj
建议这个功能是父元素默认的属性。等要想设置大小的时候,再给父元素设置一下。

from nim_duilib_framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.