3.25
swtich开关
•	所花时间:2
•	代码行数:311
•	博客容量:1
•	代码如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="是否打开开关"
            android:layout_weight="1"
            />
        <Switch
            android:layout_weight="1"
            android:layout_gravity="right"
            android:id="@+id/sw_a"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:padding="5dp"/>
    </LinearLayout>
</LinearLayout>
 
                    
                     
                    
                 
                    
                 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号