0
的Android 2.3.3线性布局 - 内用线性布局没有得到显示
我试图创建一个标题时考虑以下思路
Expression
S.NO Result
1. 1+2+3
6
2. 2+3-4
1
.....
的数据是从数据库填充到列表显示。我正在尝试为列表视图的标题部分创建一个XML。 (SNO,表达,结果)。
这里是我使用的XML ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:paddingTop="5dp" >
<LinearLayout
android:id="@+id/ll1"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="0.10"
android:orientation="horizontal" >
<TextView
android:id="@+id/txtView_History_Count"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.10"
android:text="Number"
android:textColor="#FFFFFF"
android:textSize="22dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll2"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="0.90"
android:orientation="horizontal" > //If I change this to Vertical,
//the Output is not displayed
<TextView
android:id="@+id/txtView_History_Result"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:textSize = "22dp"
android:text="Result"
android:textColor="#316DA2" />
<TextView
android:id="@+id/txtView_History_Expression"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="Expression"
android:textColor="#FFFFFF"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout>
如果我改变第二内部布局垂直的方向,不被显示的文本。出了什么问题?另外,我希望第一个布局为总可用空间(android:layout_weight =“0.10”)的10%,第二个布局为90%(android:layout_weight =“0.90”)。然后,第二个布局中的文本视图应该跨越第二个布局中可用空间的50%。有没有一种方法来创建这个,没有嵌套的权重?
更改父线性布局方向垂直后。 – 2013-03-16 11:03:50
但是,这将使表达式和结果进入SNO。我希望他们并肩。 – 2013-03-16 11:05:47