【发布时间】:2019-03-01 12:32:26
【问题描述】:
我的布局预览不只显示我添加的文本视图和按钮的操作栏,当我添加一个新按钮或文本视图时,即使我尝试使用相对和约束布局,它也只是转到屏幕的左上角.我试过使用"Base.Theme.AppCompat.Light.DarkActionBar",但没有解决。自从我在我的新 PC 上安装了 android studio 后,我就遇到了这个问题。Here's a screenshot of my layout preview
<?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">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Create Account" />
</RelativeLayout>
【问题讨论】:
-
显示您的布局 xml 代码。
-
我已编辑问题以包含 xml 代码
标签: android