當前位置:首頁 » 安卓系統 » android禁止滾動

android禁止滾動

發布時間: 2023-03-03 21:38:43

① Android 滾動條 ProgressBar 怎麼停止

您好,很高興能幫助您
如果你把內容包含在ScrollView中,當內容超出高度時會自動出現滾動條。

另外,使用控制項HorizontalScrollView 來包住你的內容時,
如果你的內容假設是一個LinearLayout, 那麼當LinearLayout的寬度超過屏幕時, 將會自動產生滾動條,當你拖動滑鼠時,效果跟scrollView一樣,不過是橫向而己

例:
縱向滾動
<ScrollView>
<LinearLayout ........>
<TextView ...../>
<TextView ...../>
<TextView ...../>
<TextView ...../>
</LineraLayout>
</ScrollView>

模向滾動
<HorizontalScrollView >
<LinearLayout ........>
<TextView ...../>
<TextView ...../>
<TextView ...../>
<TextView ...../>
</LineraLayout>
</HorizontalScrollView >

有時候甚至可以做到橫向縱向都支持,只需要你合理設計就可以, 注意ScrollView中只能加一個控制,不能超過兩個
你的採納是我前進的動力,
記得好評和採納,答題不易,互相幫助,

② android 如何禁止scrollview 滾動

android scrollview組件禁止滑動的方法;
xml配置:
android:id="@+id/sc_freement"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/category_line"
android:scrollbars="none"
android:fadingEdge="none">
</<span style="line-height: 21px; ">ScrollView>
java代碼控制:
ScrollView scrollView = (ScrollView)this.findViewById(R.id.sc_freement);
scrollView.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
return true;
}
});

熱點內容
linuxshell命令行 發布:2025-05-10 04:16:12 瀏覽:749
廣東人社賬號密碼多少 發布:2025-05-10 03:43:11 瀏覽:617
python對象參數 發布:2025-05-10 03:43:11 瀏覽:576
自己伺服器搭建梯子 發布:2025-05-10 03:31:39 瀏覽:574
華為升級包怎麼解壓 發布:2025-05-10 03:18:24 瀏覽:604
c語言以什麼結束 發布:2025-05-10 03:18:22 瀏覽:258
160android 發布:2025-05-10 03:03:30 瀏覽:179
pythonstorage 發布:2025-05-10 02:58:38 瀏覽:501
如何查看電腦配置顯卡參數 發布:2025-05-10 02:37:00 瀏覽:106
證券交易密碼在哪裡修改 發布:2025-05-10 02:31:56 瀏覽:839