标签:android style blog http io color ar 使用 sp
1.实现新的ActionBarDrawerToggle动画
ActionBarDrawerToggle使用最新的AppCompat_v7 21会出现一个很帅的动画,使用方式在Androidstudio下面先添加compile
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
}之后的构造方法就可以使用
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.app_name, R.string.app_name);
当然需要一个ToolBar。
2.使用ToolBar代替ActionBar
Android L添加了一个新控件来一步步的替换ActionBar,ToolBar有着更灵活的扩展,完全能够代替ActionBar,并且有着自己作为一个View的灵活性。只是有点不方便的是,ToolBar需要在每个Activity中声明,不管是在XML中或者代码
<resources>
<style name="AppTheme" parent="Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<!-- Actionbar color -->
<item name="colorPrimary">@color/accent_material_dark</item>
<!--Status bar color-->
<item name="colorPrimaryDark">@color/accent_material_light</item>
<!--Window color-->
<item name="android:windowBackground">@color/dim_foreground_material_dark</item>
</style>
</resources>如果你原来使用ActionBarPullToRefresh控件这个时候会发现,进度条和底边有俩个dp的间隔,如果使用了ToolBar,那么你就可以控制ActionBar的高度,当然你可以修改ActionBarPullToRefresh源码来解决这个问题 <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
></android.support.v7.widget.Toolbar>Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);

public class TintSpinner extends android.widget.Spinner {
private static final int[] TINT_ATTRS;
public TintSpinner(android.content.Context context) { /* compiled code */ }
public TintSpinner(android.content.Context context, android.util.AttributeSet attrs) { /* compiled code */ }
public TintSpinner(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr) { /* compiled code */ }
}
标签:android style blog http io color ar 使用 sp
原文地址:http://blog.csdn.net/mobilexu/article/details/41122789