lihangleo2 / ShadowLayout

可定制化阴影的万能阴影布局ShadowLayout 3.0 震撼上线。效果赶超CardView。阴影支持x,y轴偏移,支持阴影扩散程度,支持阴影圆角,支持单边或多边不显示阴影;控件支持动态设置shape和selector(项目里再也不用画shape了);支持随意更改颜色值,支持随意更改颜色值,支持随意更改颜色值。重要的事情说三遍
MIT License
3.46k stars 401 forks source link

select在启动的时候不生效 #112

Closed StrikeZXA closed 3 years ago

StrikeZXA commented 3 years ago

例如:在demo中的ShapeActivity的onCreate方法设置 binding.ShadowLayoutImage.setSelected(true) 快速关闭activity,然后重新打开有时不生效,而且出现概率很高,最新版本,能力有限,还请大佬不吝赐教,多谢

StrikeZXA commented 3 years ago

现在这样可以解决在acitivy启动时设置默认不生效的问题 findViewById(R.id.slSelectContainer).post { findViewById(R.id.slSelectContainer).isSelected = true }

lihangleo2 commented 3 years ago

这个问题很久之前的版本出现过。你确定用的是3.2.2?

lihangleo2 commented 3 years ago
       你肯定用的是下面这个方式,加子view的是没有任何问题的。不过我也发现是什么问题了。待会会出个包感谢你的支持
       <com.lihang.ShadowLayout
        android:id="@+id/ShadowLayout_image"
        android:layout_width="120dp"
        android:layout_height="36dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="10dp"
        app:hl_cornerRadius="18dp"
        app:hl_cornerRadius_leftTop="0dp"
        app:hl_layoutBackground="@mipmap/test_background_false"
        app:hl_layoutBackground_true="@mipmap/test_background_true"
        app:hl_shapeMode="selected" />