使用Xcode进行iOS开发时,发现一个bug,为什么我的英文单词,无论大写小写,显示出来的全是大写呢?
有人说,因为输入的时候使用拼音的字母输入,这样xcode认为还是中文,所以需要使用英文键盘输入……
尝试,无效。
真正的原因很简单,只因XCode生成项目时的这一句代码:
index.css中有这一段代码
body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;
background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
font-size:12px;
height:100vh;
margin:0px;
padding:0px;
/* Padding to avoid the "unsafe" areas behind notches in the screen */
padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-right, 0px);
text-transform:uppercase;
width:100%;
}
请注意倒数第三行:text-transform:uppercase;
问题就出在这里啦,把它删掉即可。