Android Studio 第二次作业
移通152 欧阳雪
Android studio第二次作业是要求写一个布局,一个手机屏幕分为3个板块,第一、二个板块占整体的1/4,第三个板块在竖着分两个板块,第一个占竖着板块的1/3,第二个占竖着板块的2/3.。
代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:weightSum="1">
 
   <linearlayout
       android:orientation="vertical"
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:weightSum="1">
       <linearlayout
           android:orientation="horizontal"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:layout_weight="0.25"
           android:background="#CCFF66"
           >
       <linearlayout
           android:orientation="horizontal"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:layout_gravity="center_horizontal"
           android:layout_weight="0.25"
           android:background="#DDDDFF"
           >
       <linearlayout
           android:orientation="horizontal"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:layout_weight="0.5">
           <linearlayout
               android:orientation="vertical"
               android:layout_width="wrap_content"
               android:layout_height="match_parent"
               android:layout_weight="0.3"
               android:background="#CC6666"
               >
           
           <linearlayout
               android:orientation="vertical"
               android:layout_width="wrap_content"
               android:layout_height="match_parent"
               android:layout_weight="0.7"
               android:background="#990066"
               >
 
                    
                     
                    
                 
                    
                 
                
            
         
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号