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

Categories

HOME
scikit-learn
polymer
dns
object
powerpoint
apache-spark-mllib
camera
shiro
vscode-extensions
appcelerator
nsbundle
rds
square
echo
google-cloud-datalab
fhir
appcelerator-studio
windows-ce
alamofire
azure-powershell
entitymanager
oledb
breadth-first-search
hta
monit
fat
pylons
jackson-modules
winexe
bringtofront
iis-express
tizen-tv
twiml
sqsh
corenlp-server
userdefaults
sql-delete
browser-extension
servicestack-text
magento-1.9.2.4
xcode7.3
trigonometry
lpsolve
phpdbg
jide
mesosphere
identification
appdomain
boxing
spring-data-couchbase
oozie-coordinator
gpg-signature
template-toolkit
offline.js
universal-analytics
structuremap4
simplepie
stax
cifilter
boomerang
java-money
gocql
file-move
wso2greg
nsurlsessiondatatask
fail2ban
diff3
j-security-check
umlgraph
addressing-mode
post-commit-hook
rickshaw
imagefilter
xml-namespaces
dct
authlogic
fpdi
gae-quotas
code-duplication
cnf
merb
composite-component
dopostback
extreme-programming
monotouch.dialog
saleslogix
subproject
objectquery
cross-database
urlrewriter
delimited-text
interprocess
pagemethods
duplex
murmurhash
strtod
perl5.12

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