将高度拉伸了
class="brush:java;gutter:true;">protected void setStatusBar() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { final ViewGroup linear_bar = (ViewGroup) findViewById(R.id.bar_layout); final int statusHeight = getStatusBarHeight(); linear_bar.post(new Runnable() { @Override public void run() { int titleHeight = linear_bar.getHeight(); android.widget.LinearLayout.LayoutParams params = (android.widget.LinearLayout.LayoutParams) linear_bar.getLayoutParams(); params.height = statusHeight + titleHeight; linear_bar.setLayoutParams(params); } }); } }