Android XML 样式

发布于 2024-08-18 21:35:01 字数 224 浏览 1 评论 0原文

我正在使用主题来设置 Android 中小部件的样式。

使用代码:

<item name="android:width">200px</item>

...我可以将小部件的宽度设置为 200px。

但是我如何指定“wrap_content”和“fill_parent”?

那里不允许使用字符串!

I'm using themes to style widgets in Android.

With the code:

<item name="android:width">200px</item>

... i can set the width of the widget to 200px.

But how can I specify "wrap_content" and "fill_parent"?

Strings are not allowed there!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情域 2024-08-25 21:35:01

wrap_contentfill_parentlayout_height 有效,而 layout_width 对宽度有效。

wrap_content and fill_parent are valid for layout_height and layout_width not width.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文