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

Android - JUnit test quits app after each test?
ArrayAdapter and Spinner getting null pointer exception
convert string data into double lists
Autolink action tracking in texview onClickListner
Android: cannot play mp4 video
Android Cloud to Device Messaging
Not able to fetch data from Sqlite Database
Android: Is there a way to stop AlarmReceiver fired in BootReceiver
Android TimePicker AM/PM button not invoking onTimeChanged
How to adjust saturation value in android [closed]
Android : Google Maps crashes when zooming (more than 1500 icons)
strange characters at the end of directory in android
setBackgroundDrawable is not changing the LayoutBackground
Android: Documentation for ContentProviders
how do I detect orientation change for a fragment in android
Drawing Bitmap is slow when scaled to a high resolution

Categories

HOME
algorithm
jpa
design-patterns
android-studio-2.2
toolbox
fftw
obfuscation
composite-primary-key
package
newrelic
iis-6
crystal-reports-2013
recordrtc
jxl
speech-synthesis
event-sourcing
microsoft-dynamics-nav
dimensional-modeling
google-data-studio
swagger-2.0
poedit
dpdk
easeljs
google-api-client
tiki-wiki
custom-post-type
licensing
fragment-backstack
inversion-of-control
event-flow
mockjax
hibernate-validator
github3.py
carriage-return
html-encode
fiware-cygnus
xajax
alphabetical
wurfl
z-notation
projects-and-solutions
unordered-map
trigonometry
lpsolve
importerror
show-hide
uiimage
monkey-testing
xbmc
yii2-api
reportservice2010
subnet
edit
pdf-conversion
lsyncd
gpg-signature
cvxpy
gets
node-request
winusb
x-tag
clipboard.js
lua-telegram-bot
contentcontrol
phpgrid
dynamics-nav-2016
java-money
jdi
morton-number
typemock
uncompress
amiga
aspectj-maven-plugin
grouping-sets
at-job
iiop
administration
webfinger
rickshaw
decoupling
conditionaltagsupport
syndicationfeed
artemis
inputmismatchexception
cocoalibspotify-2.0
jquery-1.9
video-codecs
onload-event
server-administration
cascadingdropdown
http-status-code-410
sqlclr
cuda-gdb
stress
urlrewriter
inline-formset
sun
great-circle

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