Alo*_*lok 1 android android-appcompat android-theme
我扩展了Material Theme并将其应用到我的活动中.
在style.xml中
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowBackground">@color/bg</item>
</style>`
Run Code Online (Sandbox Code Playgroud)
在清单中
<application
android:allowBackup="true"
android:theme="@style/AppTheme"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" >
...</application>
Run Code Online (Sandbox Code Playgroud)
我在工具栏,按钮上看到了Material Design样式,但它不适用于Pre Lollipop设备中的ImageButton,ToggleButton和Seekbar.他们出现在Holo主题中.
在我使用的gradle文件中:
compile 'com.android.support:appcompat-v7:22.1.1'
Run Code Online (Sandbox Code Playgroud)
如何将统一样式应用于所有小部件?
根据这篇博客文章,目前支持以下小部件:
对于ToggleButton,您可以尝试使用SwitchCompat.
| 归档时间: |
|
| 查看次数: |
681 次 |
| 最近记录: |