android - Pressing button through fragment -


i'm trying create application fragment on side menu bar.

my main problem when open fragment can see buttons behind , press them.

of course don't want that. tried adding property android:clickable="true" layout didn't help.

this code:

<relativelayout 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:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     android:paddingbottom="@dimen/activity_vertical_margin"     tools:context="ibuy.ibuy.addupdateitem">      .     .     .     <button         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/search_image"         android:id="@+id/btnbrows"         android:onclick="openitemtable"         android:layout_aligntop="@+id/imageview"         android:layout_alignparentleft="true"         android:layout_alignparentstart="true" />     .     .     .      <android.support.v4.widget.drawerlayout         xmlns:android="http://schemas.android.com/apk/res/android"         xmlns:tools="http://schemas.android.com/tools"         android:id="@+id/drawer_layout"         android:layout_width="match_parent"         android:layout_height="match_parent"         tools:context="ibuy.ibuy.addupdateitem"         android:clickable="true">          <fragment             android:id="@+id/navigation_drawer"             android:layout_width="@dimen/navigation_drawer_width"             android:layout_height="match_parent"             android:layout_gravity="start"             android:name="menus.smallmenu"             tools:layout="@layout/fragment_navigation_drawer"             android:alpha="255" />      </android.support.v4.widget.drawerlayout> </relativelayout> 

this code of listview of fragment on other file:

<listview     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:choicemode="singlechoice"     android:divider="@android:color/transparent"     android:dividerheight="0dp"     android:background="#cccc"     tools:context="menus.smallmenu"     android:clickable="true"/> 

what doing wrong? thank in advance!

i don't know meant "i can see buttons behind it". assume meant behind drawerlayout ui.

1) in case, can use attribute android:layout_below="@id/btnbrows". far know, ui elements should positioned, otherwise may displayed 1 on top of another, seeing.

2) issue both android:layout_width , layout_height of drawerlayout match_parent fills whole screen. competes screen space button. if button inside drawerlayout, not issue might intentional design.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -