【问题标题】:Android studio basic activity shows blankAndroid Studio 基本活动显示空白
【发布时间】:2018-08-22 02:25:02
【问题描述】:

请各位,我目前正在做一个项目,但每次我尝试实现 android 基本活动时,它都会显示为空白,有人可以帮我做什么。谢谢

【问题讨论】:

标签: java android android-layout android-studio layout


【解决方案1】:

尝试以下代码替换您的 content_main.xml 文件

<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:showIn="@layout/activity_main">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!" />

</RelativeLayout>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-03
    • 1970-01-01
    • 1970-01-01
    • 2014-08-22
    • 2022-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多