我想要对话框活动的透明导航栏和状态栏,我的风格是这样的代码:
<style name="AppTheme.Dialog" parent="Theme.AppCompat.Dialog">
<item name="colorAccent">@color/gray</item>
<item name="windowNoTitle">true</item>
</style>
,这在java中:
public class FilterActivity extends AppCompatActivity {
FloatingActionButton fab;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
setContentView(R.layout.filter_activity);
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
fab = (FloatingActionButton) findViewById(R.id.fab_filter_close);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
我的对话框活动是全屏的,背景是透明的,但导航栏和状态栏是黑色的。我该怎么办?