为什么"在按钮栏按钮应该是无国界的"在Android的API 15级?按钮、应该是、无国界、QUOT

2023-09-06 00:07:40 作者:记得的伤痛

我为Android开发的应用程序,我最近改变了API级别目标为8至15,而现在Eclipse正在警告我当按钮是在线性布局表行

I'm developing an application for Android and I recently changed the API level target from 8 to 15, and now Eclipse is warning me when the Buttons are inside Linear Layouts or Table Rows.

同样不会发生在按钮是一个相对布局

The same doesn't happen when the Button is in a Relative Layout.

警告说:

在按钮栏按钮应该是无国界的;使用   风格=机器人:ATTR / buttonBarButtonStyle(和   ?机器人:ATTR / buttonBarStyle父)

Buttons in button bars should be borderless; use style="?android:attr/buttonBarButtonStyle" (and ?android:attr/buttonBarStyle on the parent)

我可以按照建议或甚至SUP pressing它摆脱了警告,但我想知道现在为什么呢?有什么问题边框按钮?

I can get rid of the warning by following the suggestion or even by suppressing it, but I'm interested to know why this now? What's wrong with bordered buttons?

推荐答案

无边框按钮设计的凝聚力整个android平台。我们推荐你遵循的准则,使用户感觉你的应用是本机和不伸出像突兀,但也有很多情况下,它只是没有任何意义,就像如果它使你的应用程序看起来不专业。如果是这样的话,你可能要关闭该警告。

The borderless buttons are for cohesiveness of design throughout the android platform. It's recommended you follow the guidelines so that the user feels that your app is native and does not stick out like a sore thumb, but there are many cases where it just doesn't make sense, like if it makes your app look unprofessional. If that is the case, you may want to turn off the warning.

要关闭该警告,转到项目属性 - > Android的皮棉preferences。搜索边界或按钮样式,改变严重忽略右下角。

To turn off the warning, go to the project properties -> Android Lint Preferences. Search for "border" or "ButtonStyle" and change the severity to ignore on the bottom right.

您也可以在Eclipse preferences所有项目做到这一点。

You can also do this in Eclipse preferences for all projects.

有关Android的Studio用户: 文件 - >设置 - >编辑 - >检查 - > Android的皮棉。搜索无国界,并取消或更改严重性。

For Android Studio Users: File -> Settings -> Editor -> Inspections -> Android Lint. Search for "borderless" and uncheck or change the severity.

 
精彩推荐
图片推荐