xml - button is invisible on the android.support.v7.widget.Toolbar -


i have placed button in front of toolbar, problem is, not visible users. want button visible in toolbar, or should placed on toolbar.

here code

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/hello" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_blue_dark" tools:context="com.hackerinside.jaisonjoseph.radioplanet.intro">   <imageview     android:id="@+id/imageview"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:foregroundgravity="center"     android:src="@drawable/ione" />  <android.support.v7.widget.toolbar     android:id="@+id/toolbar2"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_alignparentleft="true"     android:layout_alignparentstart="true"     android:background="@android:color/holo_blue_dark"     android:elevation="16dp"     android:minheight="?attr/actionbarsize"     android:theme="?attr/actionbartheme" />  <button     android:id="@+id/button"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_alignparentend="true"     android:layout_alignparentright="true"     android:elevation="16dp"     android:text="button" /> 

button invisible on android.support.v7.widget.toolbar

put button inside toolbar layout

<android.support.v7.widget.toolbar     android:id="@+id/toolbar2"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_alignparentleft="true"     android:layout_alignparentstart="true"     android:background="@android:color/holo_blue_dark"     android:elevation="16dp"     android:minheight="?attr/actionbarsize"     android:theme="?attr/actionbartheme">  <button     android:id="@+id/button"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:elevation="16dp"     android:text="button" /> </android.support.v7.widget.toolbar> 
  • you can create button inside toolbar using menu item menu.xml

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -