书上介绍说可以用权重android:weightSum对LinearLayout进行比例划分,但是不行啊。
比如LinearLayout上有三个textview,每个textview的android:layout_weight="1";
如果每个textview的text的内容长度是一致的,就可以等比划分,但是text的长度不一样就不行了啊。
比如LinearLayout上有三个textview,每个textview的android:layout_weight="1";
如果每个textview的text的内容长度是一致的,就可以等比划分,但是text的长度不一样就不行了啊。
解决方案 »
- 如何根据已知的两个地点,在googlemap上获取两点之间的交通线路
- android 新浪微博开发疑问
- 急急、、、
- viewpager如何监听第一页再左滑?
- Android Eclipse中现有项目Ctrl+鼠标左键没办法使用,还有Graphical Layout没办法显示。
- 我想实现一个从数据库加载数据的下拉刷新列表,但是每次刷新后,数据都加载到了最后,怎样才能从顶部开始加载
- android canvas绘制的图片全是黑的的了
- 聊天界面listview中要如何保持含有进度条的item??
- 跪求,openFileOutput()函数为什么不能调用
- 用c++写安卓程序,怎么进行编码转换,GBK和UTF-8互相转换
- 手机拍照时出现闪屏,大伙给提供下解决思路啊。
- 新手小白问题 android:theme 如果需要用到多个要怎么写?
android:layout_width="fill_parent"
android:layout_weight="1"
试试看
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="38dip"
android:background="#0000AA"
android:orientation="horizontal" > <TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:maxLines="1"
android:background="#FF0000"
android:hint="好好学习,天天向上"
android:singleLine="false" /> <TextView
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:background="#FFFF00"
android:text="无" /> <TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#F55F00"
android:text="无tryrd yui" /></LinearLayout>