您好,登錄后才能下訂單哦!
今天在做一個app引導(dǎo)界面的時候,想設(shè)置成全屏顯示,一直報錯aused by: android.util.AndroidRuntimeException:
requestFeature() must be called before adding content,百度了很多都不行后來實在沒辦法了,Google了一下,終于解決了,由于我用的是Google最新的開發(fā)工具,繼承的是ActionBarActivity,改成繼承Activity 完美解決??!
//supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); //取消標(biāo)題 requestWindowFeature(Window.FEATURE_NO_TITLE); //取消狀態(tài)欄 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // 寫在 super.onCreate(savedInstanceState);this.setContentView(R.layout.activity_main); 之前
public class MainActivity extends Activity { private ViewPager mPager; private ArrayList<View> mPageViews; private MyPagerAdapter mPageAdapter; private ViewPager mFramePager; private ArrayList<View> mFramePageViews; private MyPagerAdapter mFramePageAdapter; @Override protected void onCreate(Bundle savedInstanceState) { //supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); //取消標(biāo)題 requestWindowFeature(Window.FEATURE_NO_TITLE); //取消狀態(tài)欄 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_main); initViewPager(); }
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。