2
我正在使用葉柵3.9,並且很難製作容器滾動。這是我的視覺代碼。葉柵3.9 - 製作容器滾動
<stackLayout id="parent_container" dockLayout.halign="center"
y="60"
height="{contentHeight}"
width="{contentWidth}"
>
<gridLayout columns="2" width="{contentWidth}" id="want_scroll">
<text string="First Name" />
<text string="First name goes here" font="{@csm.fc.font.h4}" />
<text string="Last Name" />
<text string="Last name goes here" font="{@csm.fc.font.h4}" />
// more items, causing the height to be more than that of the parent
</gridLayout>
我想「want_scroll」能夠能夠滾動它的高度比{}或contentHeight的「parent_container」的高度。我認爲在scrollView中使用pointer.scrollable設置爲true來包裝「want_scroll」會起到一定的作用。但這樣做沒有區別。
<scrollView pointer.scrollable="true">
<gridLayout columns="2" width="{contentWidth}" id="want_scroll">
<text string="First Name" />
<text string="First name goes here" font="{@csm.fc.font.h4}" />
<text string="Last Name" />
<text string="Last name goes here" font="{@csm.fc.font.h4}" />
// more items, causing the height to be more than that of the parent
</gridLayout>
</scrollView>
如何添加滾動到一個簡單的容器?
請注意,通過滾動,我只想容器是可滾動的,我的問題不是關於在右側顯示滾動條。