出于某种原因,我无法将ImageView对齐到我的Android应用程序中的顶部活动。例如:Android无法将ImageView对齐到活动顶部
<?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" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:scaleType="fitStart"
android:src="@drawable/myImage" />
<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
我能得到的ImageView对齐与“fitStart”活动的顶部,但是不那么ImageView的不会是顶部的所有道路。既然ImageView在最前面,那么ListView并不直接在它下面。相反,它是屏幕的四分之一。这发生在我所有的活动上,即使没有ListView的活动。
作为一个附注,我从AndroidManifest中删除了系统标题栏。但是,即使我将它们添加回来,问题仍然存在。
任何想法?
固定不幸的是,情况并非如此,我相信没有透明边框。不错的想法,但! – littleK
你可以把你的图片上传到你的问题中吗?我想在我的布局中使用它... – inazaruk
好吧,我在您的布局中使用了纯色图像,在我的情况下,图像完全与顶部对齐。 – inazaruk