Constraint遇到的那些坑之Android View设置visible无效的问题
发现问题
近期在开发界面的时候,需要做Android的控件显示隐藏的操作,发现在代码中设置visible属性不生效,再看代码确确实实也执行了。发现问题很诡异,排查了很久终于解决了。
Talk is cheap.Show me your code.
当当当当~
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Button
android:id="@+id/button_1"
android:layout_width="wrap_content"
android: