Navigation bar is not visible in my app Android (Eclipse) -


when create android app in eclipse, navigation bar not displayed in activity_main:

does know how fix?

you have sure android:theme in android manifest this:

<style name="apptheme" parent="theme.appcompat.light.darkactionbar"> </style> 

and since android 5 actionbar not used, recommended use toolbar. activity has extend appcompatactivity

import android.support.v7.app.appcompatactivity; //...  public class mainactivity extends appcompatactivity {     //...     @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);          toolbar toolbar = (toolbar) findviewbyid(r.id.appbar);         setsupportactionbar(toolbar);     } } 

you can custom toolbar:

<linearlayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     tools:context=".mainactivity">      <android.support.v7.widget.toolbar         xmlns:android="http://schemas.android.com/apk/res/android"         xmlns:app="http://schemas.android.com/apk/res-auto"         android:id="@+id/appbar"         android:layout_height="wrap_content"         android:layout_width="match_parent"         android:minheight="?attr/actionbarsize"         android:background="?attr/colorprimary"         android:elevation="4dp"         android:theme="@style/themeoverlay.appcompat.dark.actionbar"         app:popuptheme="@style/themeoverlay.appcompat.light" >      </android.support.v7.widget.toolbar>   </linearlayout> 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -