1

是否可以通过绑定设置可见性?(尺寸.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。

4

1 回答 1

2

如何选择不同的尺寸(布局、api 等等),您应该使用相同的机制来选择另一个布局,甚至是设置可见性的不同样式。其他所有方式似乎都是一种滥用方式:)

于 2013-10-21T12:18:50.287 回答