所以我有这个
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bgdark"
android:orientation="vertical"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="76dp"
android:src="@drawable/myheader_250x60"
/>
<ListView
android:id="@+id/mainListview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</LinearLayout>
注意 我现在已经编辑了这篇文章。我使用的是灰色背景图片,所以我认为这是标题图片右侧/左侧可见的内容。请参见下面的图片显示问题。
但是把背景移到listview上并没有解决问题。因此,似乎是 imageview 以某种方式具有灰色的左/右边框。因为我已将宽度设置为“match_parent”,所以它应该采用最大宽度。
问题是标题的顶部/右侧有灰色像素边框?如果可能的话,我想删除它。
最佳答案
尝试 scaleType attribute为您的 ImageView。
另一种方式——替换
android:src="@drawable/myheader_250x60"
对于
android:background="@drawable/myheader_250x60"
关于无法删除的Android Activity 边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15924345/