如何在另一个视图中使用编辑文本提示中的字体大小
我想在另一个视图(特别是 TextView)中使用 EditText 提示的字体类型、颜色和大小,以在表单的其他区域中保持一致的外观。我怎样才能知道要使用什么?
我尝试在 sdk 中寻找 EditText 布局,但找不到,我希望用它来找到我可以设置的相应属性。可能类似于
android:textAppearance="?android:attr/textAppearanceSmallInverse"
有人做过类似的事情吗?
I want to use the font type, color and size of the EditText hint in another view (sepcifically a TextView) to keep a consistent look in other areas of my form. How to I find out what to use?
I have tried looking for an EditText layout in the sdk but I couldn't find one, I was hoping to use that to find the corresponding attribute that I can set. Probably something along the lines of
android:textAppearance="?android:attr/textAppearanceSmallInverse"
Anyone done anything similar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一个有效的解决方案(至少在模拟器和我的 HTC Hero 上)
我检查了 android/widget/TextView.java 中的代码并进行了修改,直到我想出了这个...
我想这可能不是正确的解决方案,因为 textAppearanceMediumInverse 在大型或小型设备上看起来不正确,但现在可以使用...
编辑设备大小无关
这似乎解决了小/中/大问题
我将暂时保留这个问题,如果有人有我可以接受更好的答案,但这看起来对我有用。
I've found a solution that works (at least in the emulator and on my HTC Hero)
I examined the code in android/widget/TextView.java and tinkered about until I came up with this...
I guess this is probably not the right solution, because textAppearanceMediumInverse won't look right on a Large or Small device but this works for now...
Edit device size independent
This seems to solve the small/medium/large problem
I'll leave this question open for a while, in case someone has a better answer that I can accept but this looks like it is working for me.