嗨我想創建一個列表視圖包含一個圖像和兩個文本view.i創建它們,並檢查他們工作正常時,文本很小說你好世界,但是當我有大文本只有一個文本視圖是可見的.i知道它由於linearlayout作爲文字大小增加其他textview將下降,所以不可見任何人都可以請建議一個佈局或指導方針如何處理大型文本或改變列表視圖的大小,以便當文本是大的listitem的大小增加和當尺寸較小時尺寸減小或保持不變。 這裏是我的ListView在列表視圖中的大文本
<?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="fill_parent"
>
<ImageView
android:layout_width="50px"
android:layout_height="wrap_content"
android:src="@drawable/s3" />
<LinearLayout
android:orientation="vertical"
android:layout_width="100px"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello worldjjkljllk;lk;lkklkljkjgfytedtdgihfddgihjghvssetrtyugufgfddfdsafdfugvbcfttyugbhgsdtrrtyvhv"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello world"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello world"/>
</LinearLayout>
<CheckBox
android:layout_width="30px"
android:layout_height="wrap_content"
/>
</LinearLayout>
的佈局,這裏是基地適配器類。
class base extends BaseAdapter{
@Override
public int getCount() {
// TODO Auto-generated method stub
return 5;
}
@Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
@Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
@Override
public View getView(int arg0, View arg1, ViewGroup arg2) {
// TODO Auto-generated method stub
View v;
LayoutInflater li=getLayoutInflater();
v=li.inflate(R.layout.listitem, null);
return v;
}
}