LinearLayout 绾挎€у竷灞€
LinearLayout 鎸夌収鍨傜洿鎴栬€呮按骞崇殑椤哄簭渚濇鎺掑垪瀛愬厓绱狅紝姣忎竴涓瓙鍏冪礌浣嶄簬鍓嶄竴涓厓绱犱箣鍚庛€?
LinearLayout 涓殑瀛愬厓绱犲睘鎬э細android锛歭ayout_weight鐢熸晥锛屽畠鐢ㄤ簬鎻忚堪璇ュ瓙鍏冪礌鍦ㄥ墿浣欑┖闂翠腑鍗犳湁鐨勫ぇ灏忔瘮渚嬶紝鍔犲叆涓€琛屽彧鏈変竴涓枃鏈锛岄偅涔堝畠鐨勯粯璁ゅ€煎氨鏄?锛屽鏋滀竴琛屼腑鏈変袱涓瓑闀跨殑鏂囨湰妗嗭紝閭d箞浠栦滑鐨刟ndroid:layout_weight鍊煎彲浠ュ悓涓猴細1锛屽鏋滀竴琛屼腑鏈変袱涓笉绛夐暱鐨勬枃鏈锛岄偅涔堜粬浠殑android:layout_weight鍊煎垎鍒负锛?鍜? 锛岄偅涔堢涓€涓枃鏈灏嗗崰鎹墿浣欑┖闂寸殑涓夊垎涔嬩簩锛岀浜屼釜鏂囨湰妗嗗皢鍗犲墿浣欑┖闂寸殑涓夊垎涔嬩竴锛宎ndroid:layout_weight閬靛惊鏁板€艰秺灏忥紝閲嶈搴﹁秺楂樼殑鍘熷垯锛?
鏁堟灉鍥撅細

Android LinearLayout 绾挎€у竷灞€

    <!--          甯冨眬涔嬩竴锛氱嚎鎬у竷灞€   LinearLayout                  妯悜甯冨眬锛氫竴琛屽鍒?          绾靛悜甯冨眬锛氫竴鍒楀琛?         LinearLayout鐨勫睘鎬э細              android:background                  璁剧疆鏁翠釜甯冨眬鐢婚潰鐨勮儗鏅?             android:orientation="horizontal"    瀛愬厓绱犵殑鎺掑垪闃熷舰锛屾槸妯悜鎺掑垪杩樻槸绾靛悜鎺掑垪              android:gravity="bottom"            瀛愬厓绱犲湪甯冨眬涓殑缂虹渷(榛樿)瀵归綈鏂瑰紡              android:padding                     璁剧疆瀛愬厓绱犵殑褰兼杩炴帴锛屼腑闂翠笉鐣欑┖鐧?                       瀛愬厓绱犵殑灞炴€э細              android:layout_gravity          璁剧疆鑷韩瀵硅薄鍦ㄧ埗甯冨眬涓殑鐪嬮綈鏂瑰紡锛屽彲浠ユ洿鏂扮埗甯冨眬瀵硅薄缁欏畾鐨勭己鐪佺殑鍊?             android:layout_weight           灏嗙埗甯冨眬涓墿浣欑殑灏哄鎸夊悇鍏勫紵鍏冪礌鐨剋eight鍊兼瘮渚嬭繘琛屽~鍏咃紱      -->  <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent">  <LinearLayout      android:orientation="horizontal"      android:layout_width="fill_parent"      android:layout_height="fill_parent"      android:layout_weight="1">      <TextView          android:text="red"          android:gravity="center_horizontal"          android:background="#aa0000"          android:layout_width="wrap_content"          android:layout_height="fill_parent"          android:layout_weight="1"/>      <TextView          android:text="green"          android:gravity="center_horizontal"          android:background="#00aa00"          android:layout_width="wrap_content"          android:layout_height="fill_parent"          android:layout_weight="1"/>      <TextView          android:text="blue"          android:gravity="center_horizontal"          android:background="#0000aa"          android:layout_width="wrap_content"          android:layout_height="fill_parent"          android:layout_weight="1"/>      <TextView          android:text="yellow"          android:gravity="center_horizontal"          android:background="#aaaa00"          android:layout_width="wrap_content"          android:layout_height="fill_parent"          android:layout_weight="1"/>  </LinearLayout>  <LinearLayout    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:layout_weight="1">    <TextView        android:text="row one"        android:textSize="15pt"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_weight="1"/>    <TextView        android:text="row two"        android:textSize="15pt"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_weight="1"/>    <TextView        android:text="row three"        android:textSize="15pt"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_weight="1"/>    <TextView        android:text="row four"        android:textSize="15pt"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_weight="1"/>  </LinearLayout></LinearLayout>     

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android(安卓)SurfaceView入门学习
  2. Android优质技术资源合集
  3. Android学习笔记13:表格布局管理器TableLa
  4. android xml解析生成探讨
  5. android:windowIsTranslucent &分享回调
  6. Android常用UI组件 - Button
  7. Android(安卓)Phone进程启动过程详解
  8. android 获取本地缓存文件大小,删除功能
  9. Android的服务(Service)(一)生命周期
  10. Android(安卓)AOP实现原理之字节码插桩(一