2011-05-23 37 views
0

我想创建一个非常类似于这个布局。Android - 创建类似handcent短信的布局?

enter image description here

我停留在底部。 我无法想象,如何设置一个不同的背景图像,其底部的宽度和高度覆盖整个背景,就像上面在底部有浅灰色背景的情况一样。

请帮助!

谢谢。

+0

是否尝试嵌套布局的方向为水平.. – ngesh 2011-05-23 10:06:34

+0

开始您的研究与默认短信应用程序的代码。你可以在git中找到它。你可以在那里找到底栏的代码。 – mudit 2011-05-23 10:13:25

回答

1

这有点像(这是伪代码转换为真正的XML):

LinearLayout orientation=vertical width=fill_parent height=30dp background=COLOR 
    LinearLayout orientation horizontal width=fill_parent height=0dp weight=1 
    Image wrap_content on width and height 
    EditText with width=0dp and heigh=fill_parent weight=1 
    Button wrap_content on width and height 
    /LinearLayout 

    LinearLayout orientation horizontal width=fill_parent height=wrap_content 
    TextView with width=0dp and heigh=wrap_content weight=1 gravity=left 
    TextView with width=0dp and heigh=wrap_content weight=1 gravity=right 
    /LinearLayout 
/LinearLayout 

的LinearLayout方向=垂直宽度= FILL_PARENT高度= 30DP背景= COLOR =>这是在这条线,你定义背景为整个页脚。其他布局,edittexts,textviews等不应该有背景。

+0

@NeTelnStEin我和你上面提到的完全一样,但是如何在底部设置不同的背景图片。我尝试了android:background,甚至尝试制作一个新的ImageView并将其放在底部作为背景,但事实是,两种情况下它们都不覆盖整个背景。他们在四面都留下一些空间。如何纠正这个问题? – Varundroid 2011-05-23 10:33:06

+0

编辑答案。 – neteinstein 2011-05-23 11:02:40