小编Vas*_*ile的帖子

FragmentContainerView 和 fragment 的区别

我有两个行为不同的 XML 布局,唯一的区别是一个使用了新的

  • <androidx.fragment.app.FragmentContainerView 另一个,年长的:
  • <fragment

在 AndroidStudio 中,如所附照片所示,在第一种情况下,我看不到布局。在其他布局中,我这样做。

它是 Android Studio 3.6.3 的错误,还是定义问题,如何解决?

我在 Android Studio 中看到的情况的打印屏幕

 <fragment 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/fragment"
    android:name="com.example.tasktimer.MainActivityFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:layout="@layout/a_fragment_main"/>
Run Code Online (Sandbox Code Playgroud)

android

6
推荐指数
0
解决办法
1395
查看次数

标签 统计

android ×1