gpt4 book ai didi

android - activity_main.xml 的 View 未显示在 activity_main.xml 的图形布局中

转载 作者:行者123 更新时间:2023-11-29 14:31:28 30 4
gpt4 key购买 nike

我试图在 TextView 下包含一个 View ,TextView 显示在图形布局中而不是 View 中。我附上了代码和图形布局。谁能帮帮我,出了什么问题,我该如何解决...

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
tools:context="com.example.dt_4000.MainActivity"
tools:ignore="MergeRootFrame"
>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right|center_vertical"
android:text="DT-4000"
android:textColor="#BA0"
android:textSize="36sp" />

<View
android:id="@+id/view1"
android:layout_width="wrap_content"
android:layout_height="16dip"
android:background="#F90"

/>

</LinearLayout>

enter image description here

最佳答案

Try this code it may solve your problem

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="com.example.dt_4000.MainActivity"
tools:ignore="MergeRootFrame"
>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right|center_vertical"
android:text="DT-4000"
android:textColor="#BA0"
android:textSize="36sp" />

<View
android:id="@+id/view1"
android:layout_width="wrap_content"
android:layout_height="16dip"
android:background="#F90"

/>

</LinearLayout>

关于android - activity_main.xml 的 View 未显示在 activity_main.xml 的图形布局中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26760790/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com