android
Android - Screen being hidden by Android Buttons [duplicate]
So I have a scrollable view with multiple textview and edittexts and a button. PROBLEM: My problem is that on the bottom of the page, the button is being hidden by the default Android buttons (back,home,etc..) I DONT want to disable to android buttons. I just want to make the button stay above the android buttons. I cant find a away to show it above the Android default buttons. How can I solve this? <ScrollView 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" tools:context="com.example.tiagosilva.amob_android.ToolSetupFragment" android:background="#color/AMOB_gray"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="center" android:padding="20dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_type" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <Spinner android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="#+id/spinnerToolType" android:paddingTop="10dp" android:gravity="center"> </Spinner> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_height" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_toolHeight" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_center_height" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_toolCenterHeight" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/clamp_die_lenght" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_clampDieLenght" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_radius" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_toolRadius" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tube_diameter" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_tubeDiameter" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/pusher_lenght" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_pusherLenght" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/little_roll_radius" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_littleRollRadius" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <Button android:id="#+id/btn_save_tool" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#drawable/round_buttons" android:text="#string/save" android:textColor="#color/AMOB_gray" android:layout_marginTop="10dp"/> </LinearLayout>
Put the button inside LinearLayout outside the ScrollView and set layout_gravity="bottom" <ScrollView 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" tools:context="com.example.tiagosilva.amob_android.ToolSetupFragment" android:background="#color/AMOB_gray"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="center" android:padding="20dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_type" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <Spinner android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="#+id/spinnerToolType" android:paddingTop="10dp" android:gravity="center"> </Spinner> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_height" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_toolHeight" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_center_height" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_toolCenterHeight" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/clamp_die_lenght" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_clampDieLenght" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tool_radius" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_toolRadius" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/tube_diameter" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_tubeDiameter" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/pusher_lenght" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_pusherLenght" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="#string/little_roll_radius" android:textColor="#color/AMOB_yellow" android:textSize="25dp" android:gravity="center" android:layout_marginTop="10dp"/> <EditText android:id="#+id/et_littleRollRadius" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#drawable/round" android:ems="3" android:inputType="number" android:padding="10dp" android:text="0.0" android:textAlignment="center"/> </LinearLayout> </ScrollView> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom"> <Button android:id="#+id/btn_save_tool" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#drawable/round_buttons" android:text="#string/save" android:textColor="#color/AMOB_gray" android:layout_marginTop="10dp"/> </LinearLayout>
You could move the Button wiht id btn_save_tool out of the ScrollView, then use a RelativeLayout as a root ViewGroup like this: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" app:layout_behavior="#string/appbar_scrolling_view_behavior" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#color/AMOB_gray" tools:context="com.example.tiagosilva.amob_android.ToolSetupFragment"> <Button android:id="#+id/btn_save_tool" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:background="#drawable/round_buttons" android:text="#string/save" android:textColor="#color/AMOB_gray" android:layout_marginTop="10dp"/> <ScrollView android:layout_above="#id/btn_save_tool" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- ... --> </ScrollView> </RelativeLayout>
Related Links
Randomly placing bitmaps in a grid on a custom view canvas?
Android - MultiAutoCompleteTextView input value of performFiltetring method is always empty
Get ID or position of listview text
How to tell when during countDownTimer() method a user presses a button?
Transitions on layout without changing controls on it in android
Android Studio Grade sync error - failed to find target
Filter List of Locations from the closest to the most distant
Insert operation has no effect in sqlite
Is firebase production ready for 100% offline app? [closed]
When i update an android app i am getting error code:-26.How to solve it? [closed]
Delete all records using ORMlite before a particular date
Firebase Chat After login
When to link against appcompat and constraint-layout support libraries and when not
Can we get listener of screen off gesture in our app?
How to prevent Process creating Toasts
Ionic cordova project not compiling when using phonegap-push-plugin