1
好吧,快速背景:我一直在開發簡單的音樂播放器應用程序並增強用戶體驗(特別是在新設備上)我決定使用傳說中的SystemBarTint library。當使用SystemBarTint時,我的片段被ActionBar選項卡重疊
導入.JAR,按照使用說明,修改了應用程序主題和瞧!我的應用看起來比10年陳舊的自行車更漂亮。 但是等等,還有更多!
正如你所看到的,ListView
現在由ActionBar
及其選項卡覆蓋。我做了功課,發現this解決方法 - 哪些工作,有點。
我ListView
由ActionBar
不再包括在內,但它仍然被標籤覆蓋!
我該如何對此進行排序?
這是我的BaseActivity
onCreate
方法,其激活SystemBarTint
庫:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(getResources().getColor(R.color.wowza_orange));
}
..和這是替代方法,在供給我Fragment
(其容納ListView
):
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
musicList.setClipToPadding(false); // musicList is my ListView instance.
setInsets(getActivity(), (View) musicList);
}
public static void setInsets(Activity context, View view) {
SystemBarTintManager tintManager = new SystemBarTintManager(context);
SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
view.setPadding(0, config.getPixelInsetTop(true),
config.getPixelInsetRight(), config.getPixelInsetBottom());
}
由於提前!