我有这个序列的布局:imageview,ratingbar和tabhost(包含用户和信息的审查)。对于用户的tabhost评论,我使用自定义的listview,并且我成功地显示了用户的所有评论。但我的问题,你可以看到下面的图片(列表视图身高只有1项包裹的内容,如果我把它的滚动,它可以加载所有数据)ListView只显示1项
而且我想使这个布局(它显示多个项目,作为父母的身高)
这里我的布局XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<!-- HEADER -->
<LinearLayout
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerHorizontal="true"
android:background="#dcdcdc"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_alignParentTop="true">
<ImageView
android:id="@+id/ivplacedetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:src="@drawable/search"/>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name" />
<RatingBar
android:id="@+id/ratingBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- FOOTER -->
<LinearLayout
android:id="@+id/footer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:background="#a9d633">
<Button
android:id="@+id/btnhome"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:text="Home"
android:background="@layout/round_border"/>
<Button
android:id="@+id/btnbookmark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:text="Bookmark"
android:background="@layout/round_border"/>
<Button
android:id="@+id/btnnearby"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:text="Nearby"
android:background="@layout/round_border"/>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/footer"
android:layout_below="@+id/header">
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
</TabHost>
</ScrollView>
</RelativeLayout>
我LIS tview自定义布局在这里
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imguser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:src="@drawable/atmicon"
android:scaleType="fitCenter">
</ImageView>
<TextView
android:id="@+id/lbluser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="1dp"
android:layout_toRightOf="@+id/imguser"
android:textColor="#4068ec"
android:text="Nama User">
</TextView>
<TextView
android:id="@+id/lblwaktu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imguser"
android:layout_below="@+id/lbluser"
android:layout_marginLeft="5dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
android:text="Waktu Review">
</TextView>
<TextView
android:id="@+id/lblreview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imguser"
android:layout_below="@+id/lblwaktu"
android:layout_marginLeft="5dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
android:text="isi Review">
</TextView>
</RelativeLayout>
我的ListView布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/lvreview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
有人可以帮我解决我的布局?
当您将其登录到适配器中时,您会得到10或1个什么值?问题可能是该适配器在循环完成之前填充 – Elltz 2014-10-18 18:04:39
已显示所有数据(查看),但问题现在它的高度仅仅是1个数据(查看),链接显示 – Kaizternn 2014-10-18 19:11:20