亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: [Android] Resources: Style & Themes [打印本頁]

作者: web_surf    時間: 2011-12-22 08:51
標(biāo)題: [Android] Resources: Style & Themes
  1. Docs
  2. Summary
  3. Style Inherits
    1st way: use parent attribute.
    2nd way: use name attribute with '.' seperated, such as <style name="CodeFont.Red"> which inherits from stule CodeFont.

    If you want to remove an attribute from derived style, you can override the attribute and set "@null" as its value, ie:
    <resources>
        <style name="Theme.NoBackground" parent="android:Theme">
            <item name="android:windowBackground">@null</item>
        </style>
    </resources>

  4. Referencing style attributes
    A style attribute resource allows you to reference the value of an attribute defined in the currently-applied theme.

    To reference a style attribute, the name syntax is
    ?[<package_name>:][<resource_type>/]<resource_name>


    Sample:
    <EditText
        id="text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textColor="?android:textColorSecondary"
        android:text="@string/hello_world" />

    Here, the android:textColor attribute specifies the name of a style attribute in the current theme. Android now uses the value applied to the android:textColorSecondary style attribute as the value for android:textColor in this widget. Because the system resource tool knows that an attribute resource is expected in this context, you do not need to explicitly state the type (which would be ?android:attr/textColorSecondary)—you can exclude the attr type.

    Another sample:
    <ProgressBar android:id="@+id/progress_horizontal"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="200dip"
            android:layout_height="wrap_content"
            android:max="100"
            android:progress="50"
            android:secondaryProgress="75" />

    <TextView
            style="?android:attr/listSeparatorTextViewStyle"
            android:text="@string/listSeparatorTextViewStyle"
            android:layout_marginTop="5dip"
        />

  5. xxx





歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2