Android 我的组件树项不会显示在我的设计布局上

Android 我的组件树项不会显示在我的设计布局上,android,android-layout,firebase,firebase-authentication,Android,Android Layout,Firebase,Firebase Authentication,我想用Firebase创建一个登录活动XML,但在设计布局上似乎看不到任何文本视图字段或按钮?我的代码有问题吗?我认为相对布局中可能有太多的组件?我如何最小化组件,使它们都适合 < RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: app = "http://schemas.android.com/apk/res-auto" xmlns: tools = "http://s

我想用Firebase创建一个登录活动XML,但在设计布局上似乎看不到任何文本视图字段或按钮?我的代码有问题吗?我认为相对布局中可能有太多的组件?我如何最小化组件,使它们都适合

< RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: app = "http://schemas.android.com/apk/res-auto"
xmlns: tools = "http://schemas.android.com/tools"
android: id = "@+id/main_layout"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: background = "@color/grey_100"
android: orientation = "vertical"
android: weightSum = "4" >

  <
  RelativeLayout
android: layout_width = "match_parent"
android: layout_height = "0dp"
android: layout_weight = "3"
android: gravity = "center_horizontal"
android: orientation = "vertical"
tools: ignore = "ObsoleteLayoutParam" >

  <
  ImageView
android: id = "@+id/icon"
style = "@style/ThemeOverlay.FirebaseIcon"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: contentDescription = "@string/desc_firebase_lockup"
android: src = "@drawable/firebase_lockup_400" / >

  <
  TextView
android: id = "@+id/title_text"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_marginBottom = "@dimen/title_bottom_margin"
android: text = "@string/emailpassword_title_text"
android: theme = "@style/ThemeOverlay.MyTitleText" / >

  <
  TextView
android: id = "@+id/status"
style = "@style/ThemeOverlay.MyTextDetail"
android: text = "@string/signed_out" / >

  <
  TextView
android: id = "@+id/detail"
style = "@style/ThemeOverlay.MyTextDetail"
tools: text = "Firebase User ID: 123456789abc" / >

  <
  /RelativeLayout>

  <
  ImageView
android: id = "@+id/imageView"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
app: srcCompat = "@drawable/new_green_360"
tools: ignore = "ContentDescription" / >


  <
  RelativeLayout
android: layout_width = "fill_parent"
android: layout_height = "0dp"
android: background = "@color/grey_300"
android: gravity = "center_vertical" >

  <
  LinearLayout
android: id = "@+id/email_password_fields"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: orientation = "horizontal"
android: paddingLeft = "16dp"
android: paddingRight = "16dp" >

  <
  EditText
android: id = "@+id/field_email"
android: layout_width = "0dp"
android: layout_height = "wrap_content"
android: layout_weight = "1"
android: hint = "@string/hint_email"
android: inputType = "textEmailAddress" / >

  <
  EditText
android: id = "@+id/field_password"
android: layout_width = "0dp"
android: layout_height = "wrap_content"
android: layout_weight = "1"
android: hint = "@string/hint_password"
android: inputType = "textPassword" / >
  <
  /LinearLayout>

  <
  LinearLayout
android: id = "@+id/email_password_buttons"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: layout_below = "@+id/email_password_fields"
android: orientation = "horizontal"
android: paddingLeft = "16dp"
android: paddingRight = "16dp" >

  <
  Button
android: id = "@+id/email_sign_in_button"
android: layout_width = "0dp"
android: layout_height = "wrap_content"
android: layout_weight = "1"
android: text = "@string/sign_in"
android: theme = "@style/ThemeOverlay.MyDarkButton"
tools: ignore = "ButtonStyle" / >

  <
  Button
android: id = "@+id/email_create_account_button"
android: layout_width = "0dp"
android: layout_height = "wrap_content"
android: layout_weight = "1"
android: text = "@string/create_account"
android: theme = "@style/ThemeOverlay.MyDarkButton"
tools: ignore = "ButtonStyle" / >
  <
  /LinearLayout>

  <
  LinearLayout
android: id = "@+id/signed_in_buttons"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: layout_centerInParent = "true"
android: orientation = "horizontal"
android: paddingLeft = "16dp"
android: paddingRight = "16dp"
android: visibility = "gone"
android: weightSum = "2.0" >

  <
  Button
android: id = "@+id/sign_out_button"
android: layout_width = "0dp"
android: layout_height = "wrap_content"
android: layout_weight = "1.0"
android: text = "@string/sign_out"
android: theme = "@style/ThemeOverlay.MyDarkButton"
tools: ignore = "ButtonStyle" / >

  <
  Button
android: id = "@+id/verify_email_button"
android: layout_width = "0dp"
android: layout_height = "wrap_content"
android: layout_weight = "1.0"
android: text = "@string/verify_email"
android: theme = "@style/ThemeOverlay.MyDarkButton"
tools: ignore = "ButtonStyle" / >

  <
  /LinearLayout>

  <
  /RelativeLayout>

  <
  com.facebook.login.widget.LoginButton
android: id = "@+id/loginButton"
android: layout_width = "wrap_content"
android: layout_height = "18dp"
android: layout_alignParentBottom = "true"
android: layout_centerHorizontal = "true"
android: layout_marginBottom = "75dp"
android: paddingBottom = "10dp"
android: paddingTop = "10dp" / >

  <
  />

<
相对布局
android:layout\u width=“匹配父项”
android:layout\u height=“0dp”
android:layout_weight=“3”
android:gravity=“居中水平”
android:orientation=“垂直”
工具:ignore=“ObsoleteLayoutParam”>
<
图片框
android:id=“@+id/图标”
style=“@style/ThemeOverlay.firebase图标”
android:layout\u width=“包装内容”
android:layout\u height=“包装内容”
android:contentDescription=“@string/desc\u firebase\u lockup”
android:src=“@drawable/firebase\u lockup\u 400”/>
<
文本框
android:id=“@+id/title_text”
android:layout\u width=“包装内容”
android:layout\u height=“包装内容”
android:layout_marginBottom=“@dimen/title_bottom_margin”
android:text=“@string/emailpassword\u title\u text”
android:theme=“@style/ThemeOverlay.MyTitleText”/>
<
文本框
android:id=“@+id/status”
style=“@style/ThemeOverlay.MyTextDetail”
android:text=“@string/signed_out”/
<
文本框
android:id=“@+id/detail”
style=“@style/ThemeOverlay.MyTextDetail”
工具:text=“Firebase用户ID:123456789abc”/>
<
/相对长度>
<
图片框
android:id=“@+id/imageView”
android:layout\u width=“匹配父项”
android:layout\u height=“包装内容”
app:srcCompat=“@drawable/new_green_360”
工具:ignore=“ContentDescription”/>
<
相对布局
android:layout\u width=“fill\u parent”
android:layout\u height=“0dp”
android:background=“@color/grey_300”
android:gravity=“center\u vertical”>
<
线性布局
android:id=“@+id/email\u密码\u字段”
android:layout\u width=“fill\u parent”
android:layout\u height=“包装内容”
android:orientation=“水平”
android:paddingLeft=“16dp”
android:paddingRight=“16dp”>
<
编辑文本
android:id=“@+id/field\u电子邮件”
android:layout_width=“0dp”
android:layout\u height=“包装内容”
android:layout_weight=“1”
android:hint=“@string/hint\u电子邮件”
android:inputType=“textEmailAddress”/>
<
编辑文本
android:id=“@+id/field\u密码”
android:layout_width=“0dp”
android:layout\u height=“包装内容”
android:layout_weight=“1”
android:hint=“@string/hint\u密码”
android:inputType=“textPassword”/>
<
/线性布局>
<
线性布局
android:id=“@+id/电子邮件\密码\按钮”
android:layout\u width=“fill\u parent”
android:layout\u height=“包装内容”
android:layout_below=“@+id/电子邮件_密码_字段”
android:orientation=“水平”
android:paddingLeft=“16dp”
android:paddingRight=“16dp”>
<
按钮
android:id=“@+id/email\u登录\u按钮”
android:layout_width=“0dp”
android:layout\u height=“包装内容”
android:layout_weight=“1”
android:text=“@string/sign_-in”
android:theme=“@style/ThemeOverlay.MyDarkButton”
工具:忽略=“按钮样式”/>
<
按钮
android:id=“@+id/email\u创建账户\u按钮”
android:layout_width=“0dp”
android:layout\u height=“包装内容”
android:layout_weight=“1”
android:text=“@string/create_账户”
android:theme=“@style/ThemeOverlay.MyDarkButton”
工具:忽略=“按钮样式”/>
<
/线性布局>
<
线性布局
android:id=“@+id/signed_-in_按钮”
android:layout\u width=“fill\u parent”
android:layout\u height=“包装内容”
android:layout\u centerInParent=“true”
android:orientation=“水平”
android:paddingLeft=“16dp”
android:paddingRight=“16dp”
android:visibility=“消失”
android:weightSum=“2.0”>
<
按钮
android:id=“@+id/注销按钮”
android:layout_width=“0dp”
android:layout\u height=“包装内容”
android:layout_weight=“1.0”
android:text=“@string/sign_out”
android:theme=“@style/ThemeOverlay.MyDarkButton”
工具:忽略=“按钮样式”/>
<
按钮
android:id=“@+id/verify_email_按钮”
android:layout_width=“0dp”
android:layout\u height=“包装内容”
android:layout_weight=“1.0”
android:text=“@string/verify_email”
android:theme=“@style/ThemeOverlay.MyDarkButton”
工具:忽略=“按钮样式”/>
<
/线性布局>
<
/相对长度>
<
com.facebook.login.widget.LoginButton
android:id=“@+id/loginButton”
android:layout\u width=“包装内容”
android:layout_height=“18dp”
android:layout\u alignParentBottom=“true”
android:layout\u centerHorizontal=“true”
android:layout_marginBottom=“75dp”
android:paddingBottom=“10dp”
android:paddingTop=“10dp”/
<
/>

请告诉我如何设置此问题的悬赏。您的XML中没有SufFaceView。当你没有它的时候,为什么你希望在上面显示任何东西?请合理地格式化你的代码。并删除最后一个“”,这是无用的,可能有害的。如果要添加Surfaceview-through代码,请确保将其作为第一个孩子添加。我已重新格式化了问题。现在应该让伊瑟尔明白了。