在Android 中创建一个activity 可是界面一片白色 按钮和文字都不显示 怎么回事

界面一片白

代码如下
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.helloandroid.MainActivity" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello" />

<Button
android:id="@+id/myButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:text="@string/my_button_str"
/>
</RelativeLayout>

第1个回答  2015-09-04
activity的代码在哪里?没给,怎么给你排bug???追问

确实是activity中的问题 已解决 多谢

本回答被提问者采纳
第2个回答  2015-09-05
TextView 遮住了Button 其他的我试了 一切都好。 没有问题。至少这个xml文件中代码是可以用的。

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网