`
mmdev
  • 浏览: 12940261 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

Android weight运用

 
阅读更多

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="
http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<Button
android:id="@+id/button_query"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button_query"
android:layout_marginTop="5.0dip"
android:layout_alignParentBottom="true" />

<LinearLayout
android:id="@+id/l1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentTop="true"
android:layout_marginTop="10.0dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/network_available"
android:layout_weight="1.0" />

<TextView
android:id="@+id/network_available"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:layout_weight="1.0" />
</LinearLayout>

<LinearLayout
android:id="@+id/l2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/l1"
android:layout_marginTop="10.0dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/network_type"
android:layout_weight="1.0" />

<TextView
android:id="@+id/network_type"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:layout_weight="1.0" />
</LinearLayout>

<LinearLayout
android:id="@+id/l3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/l2"
android:layout_marginTop="10.0dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/network_subtype"
android:layout_weight="1.0" />

<TextView
android:id="@+id/network_subtype"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:layout_weight="1.0" />
</LinearLayout>

<LinearLayout
android:id="@+id/l4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/l3"
android:layout_marginTop="10.0dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/network_status"
android:layout_weight="1.0" />

<TextView
android:id="@+id/network_status"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:layout_weight="1.0" />
</LinearLayout>

<LinearLayout
android:id="@+id/l5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/l4"
android:layout_marginTop="10.0dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="网络连接状态(详细超超超)"
android:layout_weight="1.0" />

<TextView
android:id="@+id/network_status_detail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:layout_weight="1.0" />
</LinearLayout>

<LinearLayout
android:id="@+id/l6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/l5"
android:layout_marginTop="10.0dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/network_extra"
android:layout_weight="1.0" />

<TextView
android:id="@+id/network_extra"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:layout_weight="1.0" />
</LinearLayout>

<LinearLayout
android:id="@+id/l7"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/l6"
android:layout_marginTop="10.0dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/network_roaming"
android:layout_weight="1.0" />

<TextView
android:id="@+id/network_roaming"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceMedium"
android:layout_weight="1.0" />
</LinearLayout>

</RelativeLayout>

分享到:
评论

相关推荐

    Android weight属性demo

    详情:http://blog.csdn.net/mybeta/article/details/39547141

    4种Android屏幕自适应解决方案

    Android支持多屏幕机制即用为当前设备屏幕提供一种合适的方式来共同管理并解析应用资源。本文就介绍了4中Android屏幕自适应解决方案。 一、细说layout_weight 目前最为推荐的Android多屏幕自适应解决方案。 该...

    Android实训购物车页面

    -&lt;LinearLayout android:background="@drawable/aaa" android:weightSum="1" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" xmlns:android=...

    详解Android中weight的使用方法

    主要向大家介绍了详解Android中weight的使用方法,感兴趣的小伙伴们可以参考一下

    Android移动开发-Weight计算.zip

    Android移动开发-Weight计算.zip

    Android购物车代码

    -&lt;LinearLayout android:background="@drawable/aaa" android:weightSum="1" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" xmlns:android=...

    Android高薪之路:Android程序员面试宝典 李宁

    2 3 1 android:layout weight属性 2 3 2 android:padding属性和android:layout margin属性 2 3 3 android:layout gravity属性和android:gravity属性 2 4 高级布局技术 第3章 组件 3 1 组件的属性 3 2 文本组件 3 3 ...

    Android 重写RadioButton,模仿QQ消息气泡

    android:layout_weight="1" android:button="@null" android:drawableTop="@drawable/icon_click_wd" android:gravity="center" android:text="我的" android:textSize="10dp" /&gt; --设置值,显示气泡 rb_...

    Android代码-ANT Weight Scale Display

    ANT and ANT Android SDKs The Android ANT and Android ANT SDKs enable developers to create unique applications that use ANT wireless communication technology to communicate between a wide array of ...

    Android实现图片自动轮换

    package xatu.cn.androidtest_one; import android.content.ContentResolver; import android.content.Intent;... android:layout_weight="1" /&gt; &lt;/android.support.constraint.ConstraintLayout&gt;

    Weight.zip

    1. 布局绘制过程 2. 遍历视图 3. 在onCreate()方法中获取View的宽度和高度 4. android:measureWithLargestChild使用说明 5. weight及weightSum使用说明

    Android开发EditText属性.txt

    android:layout_weight="1"//权重,控制控件之间的地位,在控制控件显示的大小时蛮有用的。 android:textAppearance="?android:attr/textAppearanceLargeInverse"//文字外观 android:layout_gravity="center_vertical...

    Android代码-android-dropdown-menu

    You can use this to make several(as you want) listViews act like dropdown menu, the 'weight' of titles' width is adjustable. It will not intercept touch events when it get back. Use this view in xml: ...

    keepalived-weight&priority设置规则.xlsx

    控制节点角色的是Keepalived配置文件中的“priority”值,但并它并不控制所有节点的角色,另一个能改变节点角色的是在vrrp_script模块中设置的“weight”值,这两个选项对应的都是一个整数值,其中“weight”值可以...

    Android移动应用开发线性布局LinearLayout的weight属性简介.pdf

    Android移动应用开发线性布局LinearLayout的weight属性简介.pdf 学习资料 复习资料 教学资源

    Android代码-SVGAPlayer-Android

    SVGAPlayer is a light-weight animation renderer. You use tools to export svga file from Adobe Animate CC or Adobe After Effects, and then use SVGAPlayer to render animation on mobile application. ...

    Android 百分比布局

    android:layout_weight="1" android:orientation="horizontal"&gt; android:id="@+id/tv_solid_number" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="本次上架...

    Android期末作品,课表

    利用 android:layout_weight="1" 实现屏幕划分

Global site tag (gtag.js) - Google Analytics