DylanCaiCoding / LoadingStateView

Decoupling the code of toolbar or loading status view. (深度解耦标题栏,解耦加载中、加载失败、无数据等缺省页,支持两行代码集成到基类)
Apache License 2.0
674 stars 53 forks source link

margin 问题 #39

Open sceneren opened 1 year ago

sceneren commented 1 year ago

布局文件 <?xml version="1.0" encoding="utf-8"?> <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" android:orientation="vertical" tools:context=".ui.MainActivity"> <FrameLayout android:layout_width="match_parent" android:layout_height="100dp" android:background="#FF0000" android:layout_marginHorizontal="10dp" /> <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="10dp"> <TextView android:id="@+id/button" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FFFF00" android:text="This is content view" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </FrameLayout> </LinearLayout>

activty里面设置: override val contentView: View? get() = binding.container

showContent的时候界面会多一个margin