赞
踩
效果图
布局
<TextView android:id="@+id/tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="你好,这是TextView" android:visibility="gone" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:visibility="visible" /> <ImageView android:id="@+id/iv" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv" tools:src="@mipmap/cn" /> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="30dp" android:layout_height="30dp" android:background="@mipmap/cn" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/iv" />
在布局中因为各种原因,有时想让控件不显示,或者显示占位图的话,可以使用
tools:src="@mipmap/cn"
tools:visibility="visible"
tools:text=""
等属性。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。