您好,我正在尝试使用 android,我是 WP c# 开发人员。所以在将图像设置到屏幕底部中间时出现问题。在 WP 中,这对我来说很容易。所以这里是我尝试过的:-
<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 = Bottom 并完成。
我的心态现在还没有为 Android 做好准备,所以很抱歉回答这个非常基本的问题。 非常感谢任何帮助和指点:)
最佳答案
您可能必须将它放在 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>
关于android - 将 ImageView 设置为底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25653902/