如果屏幕中某元素的內容超過此元素的高度,可設置元素為scroll-view 為滾動狀態元素,這樣可以做到元素固定高度且元素內容滾動屏幕不滾動的效果;
scroll-view標簽的主要屬性分為以下幾種:
<scroll-view scroll-y="false" scroll-x="false" bindscrolltoupper="" bindscrolltolower="" bindscroll="" scroll-into-view="" scroll-top="500"
upper-threshold="10" lower-threshold="10" scroll-top="50" scroll-left="10" bindscrolltoupper='xx' bindscrolltolower="xx" bindscroll="xx"
class="largefont"> 斯蒂芬斯蒂芬是否的是大法官的格式的風格是股份是范甘迪國防生的國防生的告訴對方感受到分公司發給發送給是發 </scroll-view> </view>
scroll-x/y='true/false'----允許橫向/縱向滾動
scroll-top/left='50'--設置滾動條出現的位置
bindscroll='' 滾動中觸發的函數 event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY}
bindscrolltoupper='scrolltoupper' 滾動到頂部/左邊出發的函數scrolltoupper
bindscrolltolower='scrolltolower' 滾動到底部/右邊出發的函數scrolltolower
upper-threshold='50' 距離頂部/左邊多遠時觸發scrolltoupper函數
lower-threshold='50' 距離底部/右邊多遠時觸發scrolltolower 函數
scroll-into-view=‘id名字(無需#)’,這個是用來設置此元素的某個子元素出現在最上方,id的名字為此子元素的id