开发者社区> 问答> 正文

android studio报错XML ?报错

小白起步阶段,百思不得其解,望各位大佬帮忙看一下

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

android:layout_width="match_parent"
android:layout_height="wrap_parent"
android:text="第一个TextView"/>

android:layout_width="match_parent"
android:layout_height="wrap_parent"
android:layout_text="第二个TextView"
/>

展开
收起
爱吃鱼的程序员 2020-06-24 14:31:35 445 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    代码好好的提交后标签就消失了。。。

    android:layout_text="第二个TextView"这句是不是错了,应该是android:ltext="第二个TextView"

    android:layout_text="第二个TextView"这句是不是错了,应该是android:text="第二个TextView",上一个答案多打了个l

    少了TextView标签

    <?xmlversion="1.0"encoding="utf-8"?>
    <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"

    android:layout_width="match_parent"
    android:layout_height="wrap_parent"
    android:text="第一个TextView"/>

    android:layout_width="match_parent"
    android:layout_height="wrap_parent"
    android:layout_text="第二个TextView"
    />

    <?xmlversion="1.0"encoding="utf-8"?>
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="第一个TextView"/>
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="第二个TextView"
    />

    这样写

    2020-06-24 14:31:52
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
58同城Android客户端Walle框架演进与实践之路 立即下载
Android组件化实现 立即下载
蚂蚁聚宝Android秒级编译——Freeline 立即下载