不知道發生了什麼,我無法再在Android Studio中使用操作欄獲取應用程序。沒有視圖上的ActionBar
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
和
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:ignore="MergeRootFrame">
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="hello"/>
</LinearLayout>
例如。它不會顯示操作欄。
嘗試將'LinearLayout'替換爲'RelativeLayout',通常它可以工作。並調用'getActionBar()。show();'顯示操作欄。 –