代码之家  ›  专栏  ›  技术社区  ›  Dave G

Sense手机上的Android应用主题

  •  2
  • Dave G  · 技术社区  · 16 年前

    有没有一种方法,我可以让我的应用主题,其用户界面风格,以匹配手机的当前应用的风格?我基本上是在为不同的UI小部件(复选框、微调器、按钮等)寻找样式。

    我有一个myTouch 3G幻灯片,它运行的是HTC Sense的浓缩咖啡版本。

    更新:(感谢@Macarse的提示)

    作为澄清,我试图让我的微调器下拉列表,复选框,按钮等),以遵循目前适用于手机的感觉主题。目前,我做了以下工作,但没有成功:

    我创建了一个res/values/styles.xml文件,其中包含以下内容:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="Theme" parent="@android:style/Theme"></style>
    </resources>
    

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.division6.pwgenapp"
          android:versionCode="1"
          android:versionName="1.0">
        <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/Theme">
        ...
        </application>
        <uses-sdk android:minSdkVersion="7" />
    </manifest>
    

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.division6.pwgenapp"
          android:versionCode="1"
          android:versionName="1.0">
        <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme">
        ...
        </application>
        <uses-sdk android:minSdkVersion="7" />
    </manifest>
    

    如果我用@android:style/Theme.Light,应用程序作为一个整体呈现轻主题。我想弄清楚的是,是否有某种形式的引用允许我引用系统应用的主题。

    再次感谢您的评论。

    更新:

    谢谢大家的收看和评论。

    2 回复  |  直到 16 年前
        1
  •  1
  •   Sonu Kumar    10 年前

    是的,你可以用 inheritance

    检查 Applying Styles and Themes .

        2
  •  1
  •   Pentium10    16 年前

    推荐文章