本文整理匯總了Java中android.view.View.requestApplyInsets方法的典型用法代碼示例。如果您正苦於以下問題:Java View.requestApplyInsets方法的具體用法?Java View.requestApplyInsets怎麽用?Java View.requestApplyInsets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.View
的用法示例。
在下文中一共展示了View.requestApplyInsets方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setStatusBarColor
import android.view.View; //導入方法依賴的package包/類
/**
* set StatusBarColor
* <p>
* 1. set Flags to call setStatusBarColor
* 2. call setSystemUiVisibility to clear translucentStatusBar's Flag.
* 3. set FitsSystemWindows to false
*/
static void setStatusBarColor(Activity activity, int statusColor, boolean isLight) {
Window window = activity.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(statusColor);
int options = View.SYSTEM_UI_FLAG_VISIBLE;
if (isLight) {
options = options | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
}
window.getDecorView().setSystemUiVisibility(options);
ViewGroup contentview = (ViewGroup) window.findViewById(Window.ID_ANDROID_CONTENT);
View childview = contentview.getChildAt(0);
if (childview != null) {
childview.setFitsSystemWindows(false);
childview.requestApplyInsets();
}
}
示例2: requestApplyInsets
import android.view.View; //導入方法依賴的package包/類
public static void requestApplyInsets(View view) {
view.requestApplyInsets();
}