Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

question about the layout element

Discussion in 'UGUI & TextMesh Pro' started by fangye_Studio, Jan 27, 2015.

  1. fangye_Studio

    fangye_Studio

    Joined:
    Nov 19, 2012
    Posts:
    26
    hi guys
    I am learning the new UGUI in unity 4.6.1. now I meet a problem about the layout element using . I added a Horizontal layout on the panel , then all buttons insided are scaled to fit the panel , after tha I added layout element on one button , then adjusted the flexible width value .
    As the official Doc said , the button should keep the original width when the flexible width value is set as 0 ,which means no stretching , and when this values set as 1 the button will follow the stretch with panel .
    but now I found no changes whatever I set 0 or 1 ... I dont know which step I did wrong or misunderstand some points .

    hope you guys can help me , thanks `~~~

    图像 6.png

    图像 7.png
     
    BuFFaloBaBa likes this.
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,683
    You will also need to turn off the "Child Force Expand" on the Layout group for the dimension you want to expand, the Width in your case
     
    BuFFaloBaBa likes this.
  3. BuFFaloBaBa

    BuFFaloBaBa

    Joined:
    Jan 21, 2015
    Posts:
    4
  4. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,683
  5. fangye_Studio

    fangye_Studio

    Joined:
    Nov 19, 2012
    Posts:
    26
    sorry I forgot to read this , I had found the same solution ,still thanks for your help :)