簡體   English   中英

我該如何解決這個 android studio 問題?

[英]how can I solve this android studio problem?

我是 Android Studio 的新手,我有一個 RelativeLayout,其中有一個簡單的 TextView。 但不幸的是,我無法在我的 XML 文件的設計模式中看到我的 TextView。 這是我的 XML 代碼和該 XML 文件的設計。 有誰知道我應該如何解決這個問題? 非常感謝 :)

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/welcome_message" />
</RelativeLayout>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="match_parent">

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

</RelativeLayout>

你可以試試這個對我有用的簡單例子。 如果它不起作用,請嘗試重建 android studio 項目。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM