国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Android > 正文

Android ScrollView無法填充滿屏幕的解決辦法

2019-10-22 18:31:42
字體:
供稿:網(wǎng)友

Android ScrollView無法填充滿屏幕的解決辦法

ScrollView滾動視圖是指當擁有很多內(nèi)容、屏幕顯示不完時、需要通過滾動跳來顯示的視圖、Scrollview的一般用法如下

以下代碼在Scrollview里面放了一個RelativeLayout、并且是設(shè)置為Android:layout_height="match_parent"填充全屏的和RelativeLayout里面放置了一個TextView背景設(shè)為了一張圖片、按照代碼理解、圖片應(yīng)該是居于屏幕的最下方的

<ScrollView android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_background" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignParentBottom="true" android:background="@drawable/bottom_bg" /> </RelativeLayout></ScrollView>

但是最后運行的效果是這樣的、你會發(fā)現(xiàn)圖片并沒有局到整個屏幕的下邊、而是在上面ScrollView無法填充滿屏幕,

Android,ScrollView,無法填充滿屏幕

那么要怎么解決這個問題呢、最后我在查看文檔的時候發(fā)現(xiàn)了這樣一個屬性、設(shè)置了就可以解決這個問題了

<ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" ></ScrollView>

也就是說設(shè)置ScrollView的android:fillViewport為true、即 android:fillViewport="true"即可


注:相關(guān)教程知識閱讀請移步到Android開發(fā)頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 龙岩市| 天柱县| 大同市| 商丘市| 施秉县| 咸宁市| 农安县| 东丽区| 镇巴县| 湖口县| 天津市| 淮滨县| 方城县| 兰州市| 庆安县| 马山县| 桂阳县| 台东县| 香港 | 靖远县| 杭州市| 大安市| 栾城县| 宁蒗| 甘谷县| 龙陵县| 双峰县| 长海县| 中西区| 开原市| 黄浦区| 鹤岗市| 桂林市| 嵩明县| 阿瓦提县| 垦利县| 门源| 铜鼓县| 乐至县| 潮州市| 寻乌县|