I have two `TextView` and below `ListView` with two `TextView`.
My problem is: How do I set that value from my second `TextView` from `ListView` be right under second `TextView` which is above `ListView`.
Can anyone help?
I have 2 tableRows. In first I have 2 textView's: TextViewNameOfProduct and TextViewPriceOfProduct. In second tableRow i have a listView. ListView have also 2 textView's:textViewProduct and textViewPrice.
My problem is that the textViewPrice is not right below TextViewPriceOfProduct...it isn't aligned with TextViewPriceOfProduct. My english is bad and i I'm not sure if I was clear enough...
http://imageupload.org/?d=2ABFEE041
OPIS PROIZVODA is first textView, second is CENA. Under that are elements from listView. How to put 100 below CENA??? How to align that...if you need my xml i will put it here...
[1]: http://i.stack.imgur.com/ODWyj.jpg
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout android:id="@+id/tableLayout1" android:layout_height="wrap_content" android:layout_width="fill_parent">
<TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/tableRow7">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:layout_weight="1">
<TextView android:text="OPIS PROIZVODA"
android:id="@+id/textViewOpisProizvoda"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_weight="1">
</TextView>
<TextView android:text="CENA"
android:id="@+id/textViewCena"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_gravity="center"
android:gravity="center"
android:layout_weight="1">
</TextView>
</LinearLayout>
</TableRow>
<TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/tableRow8">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ListView
android:id="@+id/listViewPonuda"
android:layout_width="fill_parent"
android:smoothScrollbar="true"
android:visibility="visible"
android:layout_height="wrap_content"
android:textSize="14sp"
>
</ListView>
</LinearLayout>
</TableRow>
</TableLayout>
0
A
回答
0
我認爲對於listview的textview即(ListView也有2個textView的:textViewProduct和textViewPrice。),你可以使用這種佈局。您可以根據您的要求通過簡單地填充權限來調整第二個textview。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/country_name"
android:text="textViewProduct"
android:paddingLeft="10dip"
android:layout_weight="0.5"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/country_abbrev"
android:text="textViewPrice"
android:layout_gravity="right"
android:paddingRight="30dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
相關問題
- 1. 佈局問題:列表視圖在屏幕外查看
- 2. Android查看背景佈局問題
- 3. 視頻查看佈局問題
- 4. 跨線程問題與列表查看
- 5. 兩列布局:問題列
- 6. 佈局與列表
- 7. 佈局問題,下面的列表項
- 8. 問題與片段佈局
- 9. 解決問題與佈局
- 10. 問題與佈局Android
- 11. 與佈局的android問題
- 12. 問題與相對佈局
- 13. 與DIV CSS佈局問題
- 14. 重量問題與佈局
- 15. 問題與Eclipse和佈局
- 16. glsl佈局與glvertexattribpointer問題
- 17. 3列布局問題
- 18. CSS三列布局問題
- 19. (約列)CSS佈局問題
- 20. 兩列(「gap」)佈局問題
- 21. html5 3列布局問題
- 22. 2列CSS佈局問題
- 23. extJs列布局問題
- 24. CSS 3列布局問題
- 25. Magento列布局問題
- 26. 從佈局查看?
- 27. 表格佈局問題
- 28. 表格佈局問題
- 29. HTML表格佈局問題
- 30. 安卓與列表視圖行XML佈局的問題
你會添加一張圖片嗎?因爲現在,你的意思是......難以辨認。 – Kheldar
要清楚一點。我們無法得到你確切的問題以及你的情況。請你描述一下細節。 –
請打破你的句子。 – Ronnie