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)

  • 相关阅读:
    vscode source control provider not registered
    MAC NVM 安装
    《高效前端:Web 高效编程与优化实践》学习笔记
    回显服务端/client
    图像处理系列(1):測地线动态轮廓(geodesic active contour)
    Pro Android学习笔记(一三八):Home Screen Widgets(4):App Widget Provider
    怎样传输SE63的翻译内容
    <html>
    概率dp sgu495
    Android Afinal框架学习(一) FinalDb 数据库操作
  • 原文地址:https://www.cnblogs.com/feng747/p/14908922.html
Copyright © 2011-2022 走看看