close

這邊使用UGUI 來實作

1. 首先加入 Scroll View (右鍵 -> UI - > Scroll View)

2.在Scroll View底下的Content 加上Vertical Layout Group

3. 在Scroll View底下的Content 加上Content Size Fitter  並把fit 改為 Prederred Size (這邊是直立式的滑動 如果是橫的就是Horizontal Fit 改成Prederred Size)內容下圖

ContentSize.png

4. 在Content物件底下的Item 掛上 Vertical Layout Group

5. 在Item物件上面的Text 掛上Content Size Fitter 把fit 改為 Prederred Size

 

全部的圖 希望大家能看得懂=_=

LayoutGroup.png

 

PS: 如果要加上圖片或是其他的東西 但是不想要讓 其他的東西被 Item 的Vertical Layout Group改變大小

可以讓其他的東西上面 加上layout element 並且把 ignore Layout 打勾 就可以了

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 克羅 的頭像
    克羅

    克羅的UNITY教學 & 學習筆記

    克羅 發表在 痞客邦 留言(0) 人氣()