我正在尝试在可展开列表视图中显示高分辨率图像。虽然我能够显示图像,但它没有覆盖整个屏幕宽度。我尝试了很多match_parent和wrap_content的组合,但仍然没有取得任何成功。我正在使用picasso库从url加载图像并将其显示在可扩展列表视图中。
activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="deev.com.company.albumsdetails.MainActivity">
<TabHost
android:id="@+id/tabsForDetailsandAlbums"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/albumsTab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/metallicSilver"
android:orientation="vertical">
<ExpandableListView
android:id="@+id/albumsList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:indicatorLeft="android:attr/expandableListPreferredItemIndicatorLeft"
android:divider="@color/blackBottom"
android:dividerHeight="2dp">
</ExpandableListView>
</LinearLayout>
<LinearLayout
android:id="@+id/postsTab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/metallicSilver"
android:orientation="vertical">
<ListView
android:id="@+id/tab2List"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/blackBottom"
android:dividerHeight="2px"
/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
album_header.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="8dp">
<TextView
android:id="@+id/albumHeader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="20dp"
android:paddingLeft="?android:attr/expandableListPreferredItemIndicatorLeft"
/>
</LinearLayout>
album_list.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/albumContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"/>
<ImageView
android:id="@+id/albumContent2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp" />
</LinearLayout>