如何将Imageview放在其他布局后面

2024-01-05

我使用图像视图进行动画,这样它看起来就像从左到右的移动。 但我的图像显示在其他视图的前面,以便用户能够单击图像。 我正在尝试显示它behind另一种观点。

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout
    android:id="@+id/layout"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@drawable/main_bg2"
    >

     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content" >

     <Button
         android:id="@+id/languageChangePopup"
         style="?android:attr/buttonStyleSmall"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginBottom="10dp"
         android:layout_marginLeft="50dp"
         android:background="@drawable/startbtn" />

    <EditText
        android:id="@+id/showOutputEdit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="110dp"
        android:layout_marginTop="50dp"
        android:background="@drawable/display_textbx"
        android:cursorVisible="false"
        android:gravity="right|center"
        android:paddingLeft="70dp"
        android:paddingRight="70dp"
        android:textColor="#ffffff"
        android:textSize="45sp"
        android:textStyle="bold" />

    </LinearLayout>

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="match_parent" android:layout_weight="3.49">

        <TableLayout
            android:id="@+id/tableLayout1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="136dp"
            android:layout_marginTop="19dp" >

            <TableRow
                android:id="@+id/tableRow5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                 >

                <Button
                    android:id="@+id/clearBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/cbtn" />

                <Button
                    android:id="@+id/sevenBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/sevenbtn" />

                <Button
                    android:id="@+id/eightBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/eightbtn" />

                <Button
                    android:id="@+id/nineBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/ninebtn" />
            </TableRow>

            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                 >

                <Button
                    android:id="@+id/dotBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/dotbtn" />

                <Button
                    android:id="@+id/fourBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/fourbtn" />

                <Button
                    android:id="@+id/fiveBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/fivebtn" />

                <Button
                    android:id="@+id/sixBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/sixbtn" />
            </TableRow>

            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                 >

                <Button
                    android:id="@+id/zeroBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/zerobtn" />

                <Button
                    android:id="@+id/oneBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/onebtn" />

                <Button
                    android:id="@+id/twoBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/twobtn" />

                <Button
                    android:id="@+id/threeBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@string/threebtn" />
            </TableRow>

              </TableLayout>



        <LinearLayout
            android:id="@+id/layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_marginTop="16dp"
            android:layout_toRightOf="@+id/tableLayout1"
            android:background="@drawable/operation_planet"
            android:orientation="vertical" >

            <Button
                android:id="@+id/plusBtn"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginRight="10dp"
                android:layout_marginTop="20dp"
                android:background="@drawable/addbtn" />

            <Button
                android:id="@+id/minusBtn"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_marginRight="80dp"
                android:layout_marginTop="30dp"
                android:background="@drawable/minusbtn" />

                <Button
                    android:id="@+id/multiplyBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dp"
                    android:layout_marginTop="20dp"
                    android:background="@drawable/multiplybtn" />

                <Button
                    android:id="@+id/divideBtn"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginTop="30dp"
                    android:background="@drawable/dividebtn" />

        </LinearLayout>

                <Button
                    android:id="@+id/equalToBtn"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_marginBottom="21dp"
                    android:layout_toRightOf="@+id/tableLayout1"
                    android:background="@drawable/equaltobtn"
                    android:gravity="right" />

                <ImageView
                    android:id="@+id/rocketImage"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignTop="@+id/layout"
                    android:background="@drawable/spaceship" />

    </RelativeLayout>

</LinearLayout>

将图像视图放在上面(在顶部 - 父级的第一个子级)
xml 文件中的布局,这样图像将位于布局后面

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何将Imageview放在其他布局后面 的相关文章

  • 位图背景图像应支持哪些屏幕尺寸/密度组合?

    我正在编写一个应用程序 我需要一些全屏位图背景 基于我天真的阅读支持多屏 http developer android com guide practices screens support html在 Android 文档中 为了涵盖我的
  • 使用busybox在后台安装apk

    我可以在 root 设备上使用 busybox 在后台安装 apk 吗 我看到类似的东西 但它不起作用 process install CommandCapture command new CommandCapture 0 chmod 77
  • Twowayview 滚动时自动添加内边距

    我在用双向视图 https github com lucasr twoway view在我的一个项目中 这是android的扩展回收者视图 https developer android com reference android supp
  • 对话框片段嵌入取决于设备

    在我的应用程序中 用户从联系人或通话记录中选择电话号码 选择联系人非常简单 并且在手机和平 板电脑上都可以很好地工作 i e 在手机上会弹出新的全屏活动 在桌子上我会看到带有联系人列表的漂亮弹出对话框 似乎无法从通话记录中选择电话号码 因此
  • Android SQLite 从代码中转储数据库以进行错误报告

    我正在为我的一个 Android 程序开发一种诊断工具 本质上 如果用户遇到问题 我想做一些类似 SQLite 的事情dump 参考 http www sqlite org sqlite html http www sqlite org s
  • 如何在 Picasso 中使用磁盘缓存?

    我正在使用 Picasso 在我的 Android 应用程序中显示图像 load image This is within a activity so this context is activity public void loadIma
  • 如何在 Jetpack compose 中制作 FlipCard 动画

    我有一个现有的应用程序 我在其中使用 XML 中的 Objectanimator 实现了 FlipCard 动画 如下所示 如果我点击一张卡片 它会水平翻转 但现在我想将其迁移到 jetpack compose 那么jetpack comp
  • 使用Picasso从url保存图像?

    我正在尝试使用 API Picasso 保存图像 为了做到这一点 我正在尝试使用Target保存 但我无法完成这项工作 我怎么能这样做呢 Trying save image public static void imageDownload
  • Firebase Messaging FCM 在可配置的时间间隔内分发

    当您使用 FCM 向给定应用程序的所有设备发送推送时 这可能会导致许多用户同时打开他们的应用程序 从而导致大量服务器轮询 从而导致负载峰值 有没有一种方便的方法可以在给定的时间间隔内分发消息以进行计划推送 最后 我们找到了一种可能的方法 通
  • 如何将现有的 SQLite3 数据库导入 Room?

    好吧 我在桌面上使用 SQLite3 创建了一个只需要读取的某些信息的数据库 我正在制作的应用程序不需要在此表中插入或删除信息 我在 Room 数据库层上做了相当多的谷歌搜索 所有文档都需要在构建应用程序时在 Room 中创建一个新的数据库
  • 如何在其他呼叫运行时以编程方式合并呼叫(电话会议)

    我的要求是这样的 假设我当时正在拨打一个号码 并且我想以编程方式拨打另一个号码 到目前为止 我所做的是 当某些呼叫已经进行时 我能够呼叫特定号码 例如 假设我正在拨打号码 123 1 分钟后 通过使用Alarm Manger我触发一个事件来
  • startActivityForResult中的requestCode是什么意思

    我想知道我是否正确理解 requestCode 的概念 这个整数的用途是什么 我将其设置为哪个整数有关系吗 private static int CAMERA REQUEST 谢谢 requestCode 可帮助您识别您从哪个 Intent
  • 在没有 BluetoothManagerCallback 的情况下调用 getBluetoothService

    我正进入 状态getBluetoothService called with no BluetoothManagerCallback在我的 Android 应用程序中经常出现错误 我不知道是什么原因导致这个或任何有关蓝牙管理器回调的事情 谁
  • 合并 dex 程序类型已存在时出错:android.support.v4.os.ResultReceiver$MyResultReceiver

    合并dex时出错 以下是依赖项 ext anko version 0 10 5 support lib 1 0 0 alpha1 room lib 1 1 0 dependencies implementation org jetbrain
  • 数据未刷新“DynamiteModule:未找到 com.google.firebase.auth 的本地模块描述符类”

    我已经使用 Firebase 很长时间了 到目前为止 除了以下场景之外 一切都很好 有时我注意到我的应用程序不再获取新数据 我正在用一个活跃的监听器监听变化 并且我确实有keepSynced set to true 发生这种情况时 我会在日
  • Android 媒体播放器搜索栏

    我有一个创建 播放和处理媒体播放器 只是音频 的服务 但我在主要活动中有一个搜索栏 我想自然地显示音频文件的进度并允许用户搜索到不同的位置 我花了很长时间才弄清楚 将 UI 中的搜索栏连接到服务中的媒体播放器的最佳或正确方法是什么 我将这样
  • 如何使用共享首选项在两个 Android 应用程序之间共享数据?

    我有两个应用程序 App1 和 App2 我想使用共享首选项在 App1 中保存数据并在 App2 中访问 反之亦然 我可以在 App1 中保存数据并在 App2 中访问数据 但反之则不行 这就是我现在正在做的 在清单中 android s
  • 如何关闭导航抽屉以使用返回主页图标按钮?

    我也将操作栏与搜索栏一起使用 并且我需要像后退按钮一样使用 ActionBar ico 但我也在使用导航抽屉 如何关闭 隐藏 禁用导航抽屉菜单以使用后退按钮 我的 ActionBar 代码 Override public boolean o
  • 可用屏幕的尺寸

    我使用的是 Nexus 7 1280x800 android 4 2 2 API 17 我想获取屏幕的大小 将其划分为相同高度和宽度的正方形部分 我正在使用 FrameLayout 我的方块是 ImageView 的子类 我这样做 cont
  • Android项目中使用java获取电脑的IP地址

    我在用ksoap2 android http code google com p ksoap2 android 我需要使用java获取IP地址 这样我就不必每次都手动输入它 我所说的 IP 地址是指 例如 如果我这样做ipconfig使用命

随机推荐

  • scikit-learn 中 SVC 和 SVM 有什么区别?

    来自文档 http scikit learn org stable modules svm htmlscikit learn 实现了 SVC NuSVC 和 LinearSVC 这些类能够在数据集上执行多类分类 另一方面 我还了解到 sci
  • 是否总是可以使用 HTML5

    我一直注意到您可以使用 HTML5 标签播放音频文件 考虑到您只需要使用 1 个元素来播放视频和音频 这看起来真的很方便 一个例子是这个 JSFiddle http jsfiddle net oacLrnvv
  • 如何在 Windows/Linux 上设置 Java Swing 应用程序的 DPI?

    如果您的显示器的 DPI 超过 150 例如 Macbook Pro 您也可能会发现问题 Java Swing 应用程序上的字体对于高 DPI 显示器来说太小 而且我根本无法更改字体大小 它直接忽略Windows DPI 只显示最初的 DP
  • 如何在 Android 中向操作栏显示溢出菜单项

    我正在编写一个Android应用程序 我试图在其中将溢出菜单项显示到 ActionBar 使用这个很棒的教程链接 http wptrafficanalyzer in blog adding action items and overflow
  • 未找到 Codeception Yii

    我尝试使用 codecept 在 Yii2 项目中运行单元测试 并收到下一个错误 PHP Fatal error Class Yii not found in var www html mysite vendor codeception c
  • 运行应用程序时出现 iOS Phonegap Infinite Dialog 错误?

    我在为 iOS 开发 PhoneGap 应用程序时遇到问题 我刚刚将所有 html css javascript 标记复制到phonegap 应用程序中 我在 10 6 8 的 Mac 上使用 xcode3 当我运行该应用程序时 加载并安装
  • 将 nvarchar 值转换为数据类型 int 时转换失败

    我的代码隐藏中出现转换失败的错误 我的代码如下 using SqlCommand cmd new SqlCommand tempUsertype 0 Select from tbl students Select from tbl stud
  • 闪屏安卓

    我正在尝试创建一种效果 看起来就像您在拍摄设备屏幕截图时看到的闪光一样 我的问题是 有什么办法可以做到这一点吗 如果可以的话我可以改变那个小闪光灯的颜色吗 您将需要使用 FrameLayout 或relativelayout 作为根视图 然
  • 从 ResultSet 获取 Integer 对象 [重复]

    这个问题在这里已经有答案了 A ResultSet提供方法getInt 返回原始值int 是否可以获得Integer对象 它允许null 我正在检索的数据库字段可以为空并且getInt 返回我0每当该字段null Thanks 只需检查该字
  • [azure 服务总线 - 如何在 Azure 服务总线中使用 JMS 设置消息 ID

    使用 Spring JMS 向 Azure 服务总线发送消息时 消息 ID 被覆盖 因此 重复检测无法按预期工作 我读过 JMS 文档 其中说 JMSMessageId 不能由生产者设置 它由 JMS 保留供内部使用 现在的问题是如何设置
  • SQL表-根据条件组合行[重复]

    这个问题在这里已经有答案了 我有一张像这样的桌子 DateCol TaskID EventName 2017 09 25 10 A 2017 07 26 10 B 2017 07 27 10 A 2017 09 14 10 A 2017 0
  • 如何在 ASP.NET WebAPI 中返回文件 (FileContentResult)

    在常规 MVC 控制器中 我们可以使用以下命令输出 pdfFileContentResult public FileContentResult Test TestViewModel vm var stream new MemoryStrea
  • Node.js、protobuf、buffer.length..如何通过 tcp 发送结构化缓冲区/消息?

    我写了一个 node ssjs 程序 它可以 使用 TLS 模块与数据服务器 Apache MIMA 进行 TCP 连接 好的 通过 protobuffer 模块对消息进行编码 解码 序列化 反序列化 OK 将序列化消息发送到服务器并获取响
  • 默认插入向量不是默认初始化吗?

    中的一个std vector构造函数规定为 强调我的 explicit vector size type n const Allocator Allocator Effects 构造一个vector with n 默认插入使用指定分配器的元
  • 如何在组框中获取选中的单选按钮? [复制]

    这个问题在这里已经有答案了 我的组框中有很多单选按钮 通常我会使用单独检查每个单选按钮If radiobutton1 Checked True Then 但我认为也许有一种聪明的方法来检查组框中正在检查哪个单选按钮 任何想法 try thi
  • 从 sqlite 数据库中获取最后一行

    我正在尝试从 SQLite 数据库中获取最后一行 到目前为止 我已经尝试过 max sql sequence 但似乎没有任何效果 我必须获取行值并将其分配给类变量 由于我是 SQLite 和 Android 的新手 因此非常感谢任何帮助 谢
  • 使用自定义引导加载程序创建可引导 ISO 映像

    我正在尝试将我用汇编语言编写的引导加载程序转换为ISO图像文件 以下是代码来自MikeOS http mikeos sourceforge net write your own os html引导加载程序 这是我的引导加载程序代码 BITS
  • 在 C# 中创建不同的画笔图案

    我正在尝试做一些类似于绘画的东西 我想弄清楚如何制作不同的画笔样式 就像在 Paint 3D 中一样 使用钢笔工具与使用画笔工具时 您会得到一定的线条填充 我不知道从哪里开始 我一天中的大部分时间都在浏览文档并观看 YouTube 视频 我
  • DataTable服务器端处理添加编辑列

    我正在使用数据表 1 10 13 服务器端处理 我想添加一个带有编辑用户链接的 编辑 列 这个怎么做 我的js文件 userTable DataTable processing true serverSide true ajax type
  • 如何将Imageview放在其他布局后面

    我使用图像视图进行动画 这样它看起来就像从左到右的移动 但我的图像显示在其他视图的前面 以便用户能够单击图像 我正在尝试显示它behind另一种观点