Есть ли способ иметь ListView с равным самой длинной строке? Установка параметра wrap_content для ширины ListView не влияет. ListView охватывает весь экран по горизонтали.
Это макет действия
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView android:id="@+id/listview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/country_picker_bg" />
и это строка xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginBottom="@dimen/padding"
android:padding="@dimen/padding"
android:background="@drawable/white_round_rect" >
<TextView android:id="@+id/title"
style="@style/GreyTextView"
android:layout_marginLeft="@dimen/padding"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/orange_arrow_selector"/>
</LinearLayout>
Спасибо, Gratzi