巴顿超越的背景图片 [英] Button beyond an background Image

查看:128
本文介绍了巴顿超越的背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我没有找到为标题正确的词,所以我会尽量正确地说明。

i think i don't find the correct word for the title so i will try to explain correctly.

所以我有这个图片我布局的底色:
http://imageshack.us/photo/my-images/607/fond1g。 PNG /

So i have this image for a backround of my Layout : http://imageshack.us/photo/my-images/607/fond1g.png/

和我想的按钮适合在它正确。

And i would like to the button fit in it correctly.

由于有在左侧和右侧一些transparancy。
所以按钮都超出了表。

Because there are some transparancy on the left and on the right. So the button are beyond the sheet.

有东西说:嘿,这是透明度,我不想在任何事?
或嘿,这就是(板材),我希望把一切?

Is there something for say "Hey this is transparency and i don't want anything in it" ? Or "Hey this is where (the sheet) i want to put everything ?

我试图把另一个LinearLayout中,但我不知道怎么给好宽。

I tried to put another LinearLayout but i don't know how to give the good width.

感谢

推荐答案

如果您使用的是的LinearLayout 您可以设置背景图像。然后你就可以把里面的东西的LinearLayout ,一切都将正确地适合您的映像中。

If you are using a LinearLayout you can set the background to your image. Then you can put anything inside the LinearLayout and everything will fit correctly inside your image.

例如:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"       
    android:background="#ffffff"
    android:orientation="vertical">

    <LinearLayout 
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="320dp"
        android:layout_height="512dp"       
        android:background="@drawable/scaled"
        android:orientation="vertical" >

    <Button 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="25dp"        
        android:text="Button" />

</LinearLayout>

希望有所帮助。

这篇关于巴顿超越的背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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