2013-10-21 66 views
1

是否可以通過綁定設置可見性? (dimens.xml)通過綁定設置可見性 - 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。

+0

使用可見而不是 –

+0

字符串不工作,因爲可見性是一個整數。可以使用常量View.VISIBLE等整數值,但這不是一個好方法。 – Informatic0re

回答

2

如何選擇不同的維度(佈局,api,以往),您應該使用相同的機制來選擇另一個佈局,甚至是設置可見性的不同樣式。其他方式似乎是一個虐待的方式:)

相關問題