android dimensions.xml,android – Value等于match_parent或fill_parent在dimensions.xml?
基于
here on XML Attributes部分我在我的dimensions.xml中指定以下:
-1dp
@dimen/match_parent
@dimen/match_parent
然后我使用這兩個維度在我的布局:
android:id="@+id/userAccountImage"
android:background="@drawable/user_account"
android:layout_width="@dimen/main_left_menu_user_account_width"
android:layout_height="@dimen/main_left_menu_user_account_height" />
然后,當我預覽到圖形布局,它抱怨:
You must supply a layout_width attribute.
You must supply a layout_height attribute.
實際上,我可以在dimension.xml中定義一個等于match_parent的值嗎?
更新:
我也試過這個,但預覽仍然抱怨:
-1dp
-1dp
我成功地使用了wrap_content(圖形布局根本不抱怨):
-2dp
@dimen/wrap_content
@dimen/wrap_content
總結
以上是生活随笔為你收集整理的android dimensions.xml,android – Value等于match_parent或fill_parent在dimensions.xml?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android webview 数字键盘
- 下一篇: android studio开关按钮,A