我试图弄清楚如何从 TheTVDB(例如http://thetvdb.com/banners/graphical/84947-g6.jpg)获取电视横幅以适应屏幕宽度。这让我到了那里,但我不想让空白从设置边距:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/poster"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:scaleType="fitXY" />
</LinearLayout>
但是,如果我删除它,android:layout_margin="8dp"
我突然只加载了第一个横幅的一半,但其他横幅都没有出现。
我尝试将其设置为and width
/or并删除and ,效果很好,但横幅不会在屏幕上伸展。height
wrap_content
margin
scaleType