android - 将 ImageView 设置为底部

标签 android

您好,我正在尝试使用 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/

相关文章:

javascript - 播放来自 YouTube 的视频时出现黑屏 : Phonegap Android

android - 以编程方式将带有 LayerDrawable 的 StateListDrawable 添加到 Button 的问题

android - Ecclipse Android Sdk 中的 NullPointerException 不幸的是 myapp 已停止

android - Android 上加速度计读数的最大值

Android fragment - findViewById 返回 null

android - 如何在 android 中将 db.zip 从 Assets 复制到 SD 卡

java - 了解 Android 类和方法

android - 我应该使用什么库进行 base64 编码/解码

java - Android使 View 透明,或者至少是半透明

java - 如何在本地保存和加载高分