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

How to get View in RecyclerView.Adapter for Snackbar?
In Android, how to temporarily suspend the changes to a view for a period of time?
GCM Diagnostics shows messages only for production package name
Why OnOptionsMenuClosed not called on Android
Adding Google Maps to Android app
Android ActionBar Background gets overridden by AppTheme Background
ArrayIndexOutOfBoundsException in Android 5, not in Android <=4
Application crashes when tap on ActionBar button
android lazy image loader cannot load http urls
Android error getString from resource
facebook How to get all photo of logged in User?
Recognize test in-app purchase android
Android smart power management using sensor data
Android onItemLongClick adds position to the arrayList in different activity
Live Search in Android [closed]
Add data to custom ListView scrolling list

Categories

HOME
checkstyle
codenvy
c99
apache-flink
github-for-windows
angular2-material
yahoo-finance
serialization
solaris
owl-carousel
access
google-cloud-functions
jax-ws
windows-ce
project-intu
opengl-es-3.0
eip
android-intent
azure-iot-hub
database-connection
windows-xp
sar
simpleitk
kendo-mobile
blade
dpdk
pchart
short-url
interbase
bulletphysics
openmdao
iis-express
deltaspike
angularjs-material
html-encode
raft
demo
hackintosh
attributeerror
xmldocument
wc
lampp
spring-integration-sftp
vugen
geotiff
rserve
podscms
page-replacement
ngmaterial
django-1.10
android-instrumentation
webjars
async.js
i386
lean
lua-telegram-bot
fuzzywuzzy
qbxml
iokit
oracle-spatial
ons-api
iced-coffeescript
uncompress
botan
dnssec
omnifaces
nutiteq
dot.js
imagefilter
codeplex
parallel-testing
conditionaltagsupport
git-repo
gd-graph
workitem
superscrollorama
joomla3.1
multiplexing
automationelement
massive
squishit
eclipse-marketplace
nstokenfield
strtod

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App