短視訊平臺原始碼,介面支援上下、左右的任意滑動

zhibo系統開發發表於2022-05-18

短視訊平臺原始碼,介面支援上下、左右的任意滑動

1、上下滑動

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="
    android:layout_width="match_parent"
    android:layout_height="match_parent">
 
    <LinearLayout
        android:layout_width="match_parent"
        android:orientation="vertical"
        android:layout_height="wrap_content"
        android:padding="20dp">
 
        <Button
            android:layout_width="match_parent"
            android:text="RadioButton"
            android:background="@drawable/biankuan"
            android:layout_height="66dp"
            android:id="@+id/Radio_button"
            android:textAllCaps="false"/>
 
        <Button
            android:layout_width="match_parent"
            android:text="CheckBox"
            android:background="@drawable/biankuan"
            android:layout_height="66dp"
            android:layout_marginTop="20dp"
            android:id="@+id/btn_checkbox"
            android:textAllCaps="false"/>
 
        <Button
            android:layout_width="match_parent"
            android:text="Imageview"
            android:background="@drawable/biankuan"
            android:layout_height="66dp"
            android:layout_marginTop="20dp"
            android:id="@+id/btn_imageview"
            android:textAllCaps="false"/>
 
        <Button
            android:layout_width="match_parent"
            android:text="WebView"
            android:background="@drawable/biankuan"
            android:layout_height="66dp"
            android:layout_marginTop="20dp"
            android:id="@+id/btn_webview"
            android:textAllCaps="false"/>
 
        <Button
            android:layout_width="match_parent"
            android:text="Toast"
            android:background="@drawable/biankuan"
            android:layout_height="66dp"
            android:layout_marginTop="220dp"
            android:id="@+id/btn_toast"
            android:textAllCaps="false"/>
 
    </LinearLayout>
 
 
</ScrollView>

2、左右滑動

<HorizontalScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <LinearLayout
                android:layout_width="match_parent"
                android:orientation="horizontal"
                android:padding="15dp"
                android:layout_height="200dp">
                <Button
                    android:layout_width="200dp"
                    android:layout_height="200dp"/>
 
                <Button
                    android:layout_width="200dp"
                    android:layout_height="200dp"/>
 
                <Button
                    android:layout_width="200dp"
                    android:layout_height="200dp"/>
            </LinearLayout>
        </HorizontalScrollView>

以上就是 短視訊平臺原始碼,介面支援上下、左右的任意滑動,更多內容歡迎關注之後的文章


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69978258/viewspace-2895050/,如需轉載,請註明出處,否則將追究法律責任。

相關文章