[轉]Android HorizontalScrollView和ScrollView 水平滾動 垂直滾動


本文轉自:http://hi.baidu.com/laoyang1018/blog/item/b34b241f3c7b44d6a78669b1.html

Android SDK有兩個滾動組件,HorizontalScrollView和ScrollView。一個是水平滾動,另一個是垂直滾動。兩個嵌套使用,可實現水平和垂直滾動。 

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="wrap_content">
    <HorizontalScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">
        <RelativeLayout android:orientation="horizontal"
            android:layout_width="fill_parent" android:layout_height="fill_parent">
            <!--  此處省略的組件的配置  -->
            ... ...
        </RelativeLayout>
    </HorizontalScrollView>
</ScrollView>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM