onclicklistener - Android - Click buttons through a viewpager -
i have layout contain 2 items. relativelayout
several buttons inside , viewpager
. but, can't click buttons since buttons behind viewpager
. there way can click buttons behind viewpager
? here's layout.
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_down_toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:splitmotionevents="true" android:id ="@+id/content_container"> (buttons) </relativelayout> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </framelayout>
try 1
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_down_toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <relativelayout android:layout_width="match_parent" android:layout_height="207dp" android:splitmotionevents="true" android:id ="@+id/content_container"> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="new button" android:id="@+id/button" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_marginbottom="54dp"/> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="new button" android:id="@+id/button2" android:layout_aligntop="@+id/button" android:layout_torightof="@+id/button" android:layout_toendof="@+id/button" android:layout_marginleft="53dp" android:layout_marginstart="53dp"/> </relativelayout> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="wrap_content" android:layout_height="wrap_content">
Comments
Post a Comment