- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的代码,我想改变提示文本的颜色,怎么办?
"#email":{
width: '70%',
left:'13%',
font:{
fontSize:'20sp'
},
color: '#fff',
hintText:'请输入手机号',
borderColor:'transparent',
bottom:'2%',
//backgroundColor:'#d9d9d9',
backgroundColor:'transparent',
borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED
}
最佳答案
这也可以使用支持 Android 和 iOS 的 AttributedString 和 AttributedHintText 来完成。
var emailHintText = "Your email";
var attributedEmailHintText = Titanium.UI.createAttributedString({
text : emailHintText,
attributes : [{
type : Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,
range : [0, emailHintText.length],
value : '#88817F',
}]
});
$.email.setAttributedHintText(attributedEmailHintText);
除了颜色之外,AttributedString 还允许您向字符串/提示文本添加更多属性。在 Appcelerators 文档中阅读相关信息:
AttributedString Foreground Color
更新 15.08.16
在 Titanium SDK 5.4.0.GA 版本发布后,iOS 现在支持 TextFields 的属性 hintTextColor
和方法 setHintTextColor
。在 Titanium SDK Release Notes for iOS 中阅读更多内容
关于titanium - 如何更改 textField Titanium 中的 hintText 颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28801602/
我在我的应用程序上使用 intl 进行翻译,当我在 hintText 上使用翻译时遇到问题,我收到此错误: Arguments of a constant creation must be const
我有一个像这样的 TextField,其中输入文本和提示文本的大小不同。 TextField( style: Theme.of(context).textTheme.subhead.copyW
这就是我想要做的: 在文本字段的 Flutter 文档 (https://flutter.io/text-input/) 中,它说您可以通过将 null 传递给装饰来删除下划线。但是,这也摆脱了提示文
我想在 CupertinoTextField 中添加提示文本,而不导入 Material 主题。到目前为止,我尝试将 CupertinoTextField 与 InputDecoration 混合使用
这是我的代码,我想改变提示文本的颜色,怎么办? "#email":{ width: '70%', left:'13%', font:{ fontSize
我不确定这是错误还是我未能理解其工作原理。 我正在使用 Input用于收集用户输入的小部件,我已将 hintText 字段设置为显示“在此处输入内容”,以便用户知道该做什么。这行得通并且提示文本在我的
我想增加 TextFormField 中 labelText 和hintText 之间的距离,而 contentPadding: EdgeInsets.fromLTRB(x, x, x, x) 根
当用户单击编辑按钮时,我正在尝试使用 setState 自动填充文本字段。文本已设置,但默认 hintText 和 floatingLabelText 与文本重叠。当我单击内部文本字段标签时,提示文本
我是一名优秀的程序员,十分优秀!