【问题标题】:How can I or values together in a style item?我怎样才能在一个样式项目中或值一起?
【发布时间】:2010-07-08 10:11:13
【问题描述】:

我正在尝试设置一种样式,用于在我的应用程序中的表单上的文本输入框。我有一个基本样式、TextEntry 和诸如 TextEntry.Name 之类的扩展。这是我想做的:

<style name="PgoTextEntry">
      <item name="android:textAppearance">@style/PingoText.White</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">wrap_content</item>
      <item name="android:background">@drawable/textentrybox3</item>
      <item name="android:textColorHint">@color/PingoHintColor</item>

</style>
<style name="PgoTextEntry.Name">
      <item name="android:inputType">android:textPersonName | android:textCapWords</item>
</style>

问题是,这会导致错误,“不允许使用字符串类型......”它不喜欢我将两个值 textPersonName 和 textCapWords 放在一起。

有什么想法可以做到这一点,这样我就不必手动为每个输入字段输入 inputType 了吗?

谢谢

【问题讨论】:

    标签: android coding-style android-widget


    【解决方案1】:

    我想通了。问题是我在垂直条的两侧添加了一个空格。代码应如下所示:

    <style name="PgoTextEntry.Name">
          <item name="android:inputType">textPersonName|textCapWords</item>
     </style>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-13
      • 1970-01-01
      • 2019-09-01
      • 2013-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多