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 Multiple interactive views inside one aplication (like 4 frames interactable inside one website)
java.io.FileNotFoundException on posting data from Android
After Filtering Which List Item Selected
Unity Advertising id for mobile
How to set height and width to MPAndroidChart BarChart?
Share image without WRITE_EXTERNAL_STORAGE?
how can I repeat a process in intent service?
Lost Kotlin support in Intellij Idea 14.1
How to get the MvxGridView to be efficient and performant?
Unable to start the Android emulator [duplicate]
How do I stop MediaPlayer sound while the App is closed/minimized?
Sharing resources across unit tests and instrumentation tests in Android
Calling second activity with startActivity causing crash
ViewPager in a NestedScrollView
Debugging application gives me a red line
android: is it possible to keep a title above the spinner on actionbar

Categories

HOME
sonarqube
xml
localization
formal-languages
jax-rs
jmx
fftw
grafana
vxml
onclick
limit
pearson-correlation
opengl-3
qpython
drop-down-menu
php-5.6
speech-synthesis
eip
do-while
glyphicons
android-7.0-nougat
squashfs
dataflow-diagram
exit
qliksense
flask-sqlalchemy
beta
itunes
gpio
oculus
subclass
winpe
testcomplete
anki
scatter3d
mockjax
browser-extension
urlsession
portforwarding
softmax
sharp-snmp
chronicle-map
dapper-simplecrud
opennms
automapper-5
dtsearch
geotiff
twilio-click-to-call
edit
reshape
javafx-css
angular2-testing
actor-platform
ziparchive
swizzling
stream-processing
project-organization
aspen
exim4
contentcontrol
toran-proxy
dynatree
uncompress
sql-server-data-tools
variadic-templates
android-cookiemanager
sql-scripts
spy++
rickshaw
ignite-ui
android-framework
authlogic
rfc5322
artemis
gtm-oauth2
ebay-lms
redis-py
ilasm
isa-swizzling
cgimage
convention
flex-mobile
pinch
ikimagebrowserview
denied
expression-blend-4
user-tracking
twitterizer
squishit
globals
glui
dojo-dnd
online-storage
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