后面的ImageButton和ImageView的偏移 [英] ImageButton behind ImageView and offset

查看:278
本文介绍了后面的ImageButton和ImageView的偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我努力使设计我的应用程序,我需要把一个直接的ImageButton下方的Im​​ageView的。但因为我的ImageView周围有边框有阴影我需要隐藏(上移)我的ImageButton的也许10像素我ImageView的后面。下面是我想要的快速绘图。

So I'm working on making a design for my app and I need to put a imagebutton directly below an imageview. But since my imageview has a border around it with a drop shadow I need to hide (shift up) maybe 10 pixels of my imagebutton behind my imageview. Here is a quick drawing of what I want.

我希望是有道理的。我一直在瞎搞各种不同的安排,但我不能得到我想要的东西。任何帮助将大大AP preciated。

I hope that makes sense. I've been messing around with all kinds of different arrangements but I cant get what I want. Any help would be greatly appreciated.

推荐答案

首先使用 RelativeLayout的。添加第一个的ImageButton ,然后的ImageView ,以这种方式的ImageView 将在你的的ImageButton 的顶部。那么你应该在你的设置的ImageButton 以下内容:

First of all use a RelativeLayout. Add first the ImageButton and then the ImageView, in this way the ImageView will be on top of your ImageButton. Then you should set on your ImageButton the following :

<ImageButton
    ....
    android:layout_below="@id/ImageViewId"
    android:layout_marginTop="-10px" />

这篇关于后面的ImageButton和ImageView的偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆