Demo的目的:使用自定义的split bar 。
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { BitmapDrawable bg = (BitmapDrawable)getResources().getDrawable(R.drawable.bg_striped); bg.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT); getSupportActionBar().setBackgroundDrawable(bg); BitmapDrawable bgSplit = (BitmapDrawable)getResources().getDrawable(R.drawable.bg_striped_split_img); bgSplit.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT); getSupportActionBar().setSplitBackgroundDrawable(bgSplit); }
其实所谓的格式,就是操作相应的类相应的方法导入不同的资源,以后我会多尝试不同的style形式的。这个我自己对与Demo的理解就结束了。下面开始学习Actionbarsherlock与SlidingMenu相结合的漂亮的UI界面了。