zoukankan      html  css  js  c++  java
  • 今日总结

    1.学习LinearLayout布局

     实现代码:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
        xmlns:tools="http://schemas.android.com/tools"    
        android:id="@+id/LinearLayout1"    
        android:layout_width="match_parent"    
        android:layout_height="match_parent"  
        android:orientation="horizontal" >    
        
        <TextView    
            android:layout_weight="1"    
            android:layout_width="wrap_content"    
            android:layout_height="fill_parent"    
            android:text="one"     
            android:background="#98FB98"    
         />    
         <TextView    
            android:layout_weight="2"    
            android:layout_width="wrap_content"    
            android:layout_height="fill_parent"    
            android:text="two"     
            android:background="#FFFF00"    
         />    
         <TextView    
            android:layout_weight="3"    
            android:layout_width="wrap_content"    
            android:layout_height="fill_parent"    
            android:text="three"     
            android:background="#FF00FF"    
         />    
        
    </LinearLayout>  
    LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
        xmlns:tools="http://schemas.android.com/tools"    
        android:id="@+id/LinearLayout1"    
        android:layout_width="match_parent"    
        android:layout_height="match_parent" >    
        
        <TextView    
            android:layout_weight="1"    
            android:layout_width="fill_parent"    
            android:layout_height="fill_parent"    
            android:text="one"     
            android:background="#98FB98"    
         />    
         <TextView    
            android:layout_weight="2"    
            android:layout_width="fill_parent"    
            android:layout_height="fill_parent"    
            android:text="two"     
            android:background="#FFFF00"    
         />    
         <TextView    
            android:layout_weight="3"    
            android:layout_width="fill_parent"    
            android:layout_height="fill_parent"    
            android:text="three"     
            android:background="#FF00FF"    
         />    
        
    </LinearLayout>
     

    运行效果图:

     实现代码:

    <View  
        android:layout_width="match_parent"  
        android:layout_height="1px"  
        android:background="#000000" />  

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
        xmlns:tools="http://schemas.android.com/tools"  
        android:id="@+id/LinearLayout1"  
        android:layout_width="match_parent"  
        android:layout_height="match_parent"  
        android:divider="@drawable/ktv_line_div"  
        android:orientation="vertical"  
        android:showDividers="middle"  
        android:dividerPadding="10dp"  
        tools:context="com.jay.example.linearlayoutdemo.MainActivity" >  
      
        <Button  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:text="按钮1" />  
      
        <Button  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:text="按钮2" />  
      
        <Button  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:text="按钮3" />  
      
    </LinearLayout>

    //来自于菜鸟教程2.2.1 LinearLayout(线性布局) | 菜鸟教程 (runoob.com)

  • 相关阅读:
    辨析六种单例模式
    理解模板模式
    常用DOM API总结
    自我剖析——一天的效率
    对两个数组合并,并去重
    Qt 创建一个QtDesinger第三方控件
    Qt中QComboBox中自定义界面使用stylesheet实现下拉按钮独立效果
    内核对象 windows操作系统
    python之基本内容
    python之总体理解
  • 原文地址:https://www.cnblogs.com/feng747/p/14908922.html
Copyright © 2011-2022 走看看