对齐2图像,从而第一个用作所述第二个的边界 [英] Align 2 images so the first one serves as a border for the second one

查看:127
本文介绍了对齐2图像,从而第一个用作所述第二个的边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出一种方法来调整2个图像。第一图像的边界图像(像一个偏振片)和第二图片。图片应在边境的角落开始(大约20dp左和真实的边界图像的顶部),但距离你有什么不同的屏幕...

I'm trying to find out a way to align 2 images. The first image the border image (like a polaroid) and the second a picture. The picture should start in the corner of the border (around 20dp from left and top of the real border image) but that distance varies on what screen you have...

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

                <ImageView
                    android:id="@+id/image"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <ImageView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:src="@drawable/border" />
            </RelativeLayout>

这是我现在得到:

最难的事情是图像不应该跳出边界图像和全视图(边框+图片)后面的背景是可变的!

The hardest thing is that the image shouldn't pop out the border image and the background behind the whole view (border + image) is variable!

推荐答案

我想你应该让你的边界图像9补丁:
http://developer.android.com/guide/developing/tool​​s/draw9patch.html

I think you should make your border image a 9-patch: http://developer.android.com/guide/developing/tools/draw9patch.html

这篇关于对齐2图像,从而第一个用作所述第二个的边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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