简体   繁体   English

向Android布局添加了背景,并且按钮被隐藏

[英]Added background to android layout and buttons are hidden

Added a background image to my layout and the buttons are hidden. 在我的布局中添加了背景图片,并且按钮被隐藏了。 Is there a way to bring the buttons in front of the view? 有没有办法将按钮显示在视图前面?

http://oi45.tinypic.com/1180y0l.jpg http://oi45.tinypic.com/1180y0l.jpg

Heres my layout.xml 这是我的layout.xml

Layout: 布局:

android:id="@+id/newsletter_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/resort_background"
android:gravity="fill|top"
android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp" >

<Button
    android:id="@+id/submitButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="72dp"
    android:onClick="submit"
    android:text="@string/submit" />

<Button
    android:id="@+id/noThanksButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/submitButton"
    android:layout_alignRight="@+id/submitButton"
    android:layout_below="@+id/submitButton"
    android:onClick="noThanks"
    android:text="@string/no_thanks" />

<Button
    android:id="@+id/askLaterButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/noThanksButton"
    android:layout_alignRight="@+id/noThanksButton"
    android:layout_below="@+id/noThanksButton"
    android:onClick="askLater"
    android:text="@string/ask_later" />

Thanks! 谢谢!

Fixed issue by adding color to the buttons. 通过向按钮添加颜色来修复问题。

Followed this post: Android button with different background colors 关注此帖子: 具有不同背景颜色的Android按钮

Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM