DylanCaiCoding / LoadingStateView

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

ConstraintLayout 问题 #30

Closed asker517 closed 1 year ago

asker517 commented 2 years ago
<androidx.constraintlayout.widget.ConstraintLayout 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"
    >

<FrameLayout
      android:id="@+id/layoutTest"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="show content"
        android:textColor="@color/cardview_dark_background"
        />

  </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

如上指定显示state区域contentView 为layoutTest,如果android:layout_height="0dp"调用showContentView(),实际内容并不能被正确显示出来,此时最终的layoutTest...height就为0了... @DylanCaiCoding

DylanCaiCoding commented 1 year ago

抱歉,之前处理过这个问题了,没想到上个版本优化代码时有个地方敲错。你改成下面的快照依赖看下还有没问题,没问题的话我就发个正式版。

implementation 'com.github.DylanCaiCoding.LoadingStateView:loadingstateview:master-SNAPSHOT'
DylanCaiCoding commented 1 year ago

已发 4.0.2 版本修复该问题。