是否可以通过绑定设置可见性? (dimens.xml)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="@whatever/visibility_of_this_view"
android:orientation="horizontal">...
这样我就可以在dimens.xml中放入一些内容:
<whatever name="visibility_of_this_view">visible</whatever>
我不想通过代码或不同的布局来实现,而只是使用不同的dimens.xml。
最佳答案
无论如何选择不同的暗号(布局,api等),都应使用相同的机制来选择其他布局,甚至选择设置可见性的不同样式。所有其他方式似乎是一种辱骂方式:)