码迷,mamicode.com
首页 > 其他好文 > 详细

第二次作业

时间:2016-10-29 19:40:47      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:text   设置   image   com   content   textview   round   ext   技术   

作业要求:

作一个显示框里面分成三行

一二行占这个框的1/2

第三行独占1/2

第三行里面分成两列第一列占25%,第二列占75%。

屏幕显示效果

技术分享

实现步骤:

 

 <LinearLayout
android:orientation="vertical"注意这里是横向布局
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="0.50"这里是设置前两个控件占整个布局的1/2,
android:weightSum="1">


<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第一行"设置气显示内容
android:id="@+id/textView"
android:layout_gravity="center_horizontal"
android:background="#70DBDB"设置所显示的颜色
android:layout_weight="0.50"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第二行"
android:id="@+id/textView2"
android:layout_gravity="center_horizontal"
android:background="#32CD99"
android:layout_weight="0.50"
/>
</LinearLayout>

<LinearLayout
android:orientation="horizontal"第二个的布局为纵向布局
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="0.50"
android:weightSum="1">

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="第一列"
android:id="@+id/textView3"
android:layout_weight="0.25"
android:background="#3232CD"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="第二列"
android:id="@+id/textView4"
android:background="#4D4DFF"
android:layout_weight="0.75"/>
</LinearLayout>
</LinearLayout>

 

第二次作业

标签:text   设置   image   com   content   textview   round   ext   技术   

原文地址:http://www.cnblogs.com/liuchen111/p/6011426.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!