Java 图片添加

Java 图片添加,java,android,eclipse,Java,Android,Eclipse,我希望在我的应用程序的一个屏幕的底部有一张图片,我最终实现了这一点,但是eclipse自动在图片的顶部和底部添加了一个条。我不想这样,你能帮忙吗? 如果你需要我提供更多信息,请说:P 编辑:activity_main.xml: ` `如果您没有发布相关代码,很难说发生了什么 如果使用ImageView并用XML编写布局,代码应该如下所示 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

我希望在我的应用程序的一个屏幕的底部有一张图片,我最终实现了这一点,但是eclipse自动在图片的顶部和底部添加了一个条。我不想这样,你能帮忙吗? 如果你需要我提供更多信息,请说:P

编辑:activity_main.xml:

`



`

如果您没有发布相关代码,很难说发生了什么

如果使用ImageView并用XML编写布局,代码应该如下所示

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    android:orientation="vertical" >

    ...other views for the screen...

    <ImageView
        android:layout_width="match_parent"
        android:layout_heigth="wrap_content"
        android:layout_gravity="bottom"
        android:src="@drawable/some_img" />
</LinearLayout>

你有没有通过考试?它们非常有用。

如果你发布你现在拥有的代码,它会更容易提供帮助。这就是你的意思吗?我的意思是,当它不仅显示图片,而且在顶部显示一条条纹,在底部显示一条条纹时,你知道如何解决这个问题吗?你确定这些不仅仅是调整图像大小或指示其对齐方式的编辑行吗?您使用的是纯eclipse还是随Android SDK包打包的eclipse?我使用的是打包的eclipse,我不认为它是editorlines,因为我可以通过将属性处的背景更改为#000000来将它们变为黑色。试着像我所说的那样调整XML。如果它仍然是一个问题,那么它可能在java代码中的某个地方。如果你是说RelativeLayout的背景改变了条,那么它可能只是在图像周围填充。但是如果你在根布局上做相对论,那么它应该会解决这个问题。是的,你是对的,它是填充,你能帮我解决你的建议吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    android:orientation="vertical" >

    ...other views for the screen...

    <ImageView
        android:layout_width="match_parent"
        android:layout_heigth="wrap_content"
        android:layout_gravity="bottom"
        android:src="@drawable/some_img" />
</LinearLayout>
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/InnerRelativeLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >