为什么Android在使用小于12sp的大小时给出警告? [英] Why android gives warning on using size smaller than 12sp?

查看:403
本文介绍了为什么Android在使用小于12sp的大小时给出警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我正在开发适用于7英寸平板电脑的应用程序,更特别是针对nexus 7的应用程序,并且在XML布局文件中,我得到警告

Well, I am developing app for 7 inch tablet, more specially for nexus 7, and in the XML layout file, i get warning

避免使用小于12sp的大小:11sp

如果我将任何textField的大小设置为小于12sp?

if i set the size of any textField to less than 12sp ?

我正在添加屏幕截图以更清楚地说明问题

I am adding screen shots for more clarity of the problem

推荐答案

对于默认字体缩放,1sp = 1dip = 1/160.11sp的高度约为1/15英寸,这非常小.

For the default font scaling, 1sp = 1dip = 1/160". A height of 11sp is about 1/15th of an inch, which is pretty tiny.

这是Lint错误.您可以覆盖它-按<Ctrl>-<1>,然后快速修复列表菜单将使您能够隐藏该消息.

This is a Lint error. You can override it -- press <Ctrl>-<1>, and the quick-fix list menu should give you the ability to suppress the message.

但是,如果尝试使用12sp,您可能会发现它也非常小,并且无论如何都需要更大的字体.

But, if you try 12sp, you will probably see that it too is very tiny, and that you want a larger font anyway.

这篇关于为什么Android在使用小于12sp的大小时给出警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆