2014-09-03 76 views
1

您好我正在嘗試android,我是WP c#開發人員。所以有一個問題,將圖像設置到屏幕的中下部。在WP中,對我來說很容易。所以這裏我試圖:將ImageView設置爲底部

<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:src="@android:drawable/ic_menu_gallery" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/appLogo" /> 
</LinearLayout> 

在WP我只是做一個網格,並設置VerticalAlignment =底部和完成。

我的心態不是爲android設置的,所以對於最基本的問題抱歉。 任何幫助和指針都受到高度讚賞:)

回答

1

您可能必須將它放在RelativeLayout中,然後在您的ImageView上使用android:layout_alignParentBottom="true"。像這樣:

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <ImageView 
     android:src="@android:drawable/ic_menu_gallery" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:id="@+id/appLogo" /> 

</RelativeLayout> 
+0

呦親愛的:)很棒的工作。 – loop 2014-09-03 21:35:54

+0

如果有效,請單擊複選標記以接受它爲true。祝你晚安! – user1282637 2014-09-03 21:36:53

+0

兄弟不要擔心,我會標記它正確的只是不讓我這麼快就做。 – loop 2014-09-03 21:37:53