关于《第一行代码》第三章中百分比布局以及RecyclerView出现的问题总结

百分比布局

新增两条包依赖:

implementation 'com.android.support:appcompat-v7:29.0.0'
implementation 'com.android.support:percent:29.0.0'

布局定义使用androidx:

<androidx.percentlayout.widget.PercentFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</androidx.percentlayout.widget.PercentFrameLayout>

RecyclerView

新增一条包依赖:

implementation 'com.android.support:recyclerview-v7:29.0.0'

布局定义:

<LinearLayout 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"
    >
    <androidx.recyclerview.widget.RecyclerView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        />
</LinearLayout>
发布了68 篇原创文章 · 获赞 57 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_43598138/article/details/104862078