Android buttons at top and ScrollView at bottom of the screen - android

I have two buttons "Submit" and "Reset" on top of the ui and below this is my form. The problem is when i open my keyboard, the form scrolls up and goes below the top buttons layout. What should be the problem? I want to show buutons on top only.

try this
Replace to RelativeLayout to Linearlayout With orientation Vertical.

you can try to prevent the keyboard from scrolling up your form, so the keyboard will be above your layout by doing this :
add this to your manifest
<activity
android:name="yourActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible|adjustPan"/>
then put this inside your ScrollView
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="false">
</ScrollView>
if any trouble leave a comment !
Good luck

Related

Scrollable layout when keyboard pops up, but without focus change

I have a UX problem with my layout. I want that is possible that the user can scroll over the compleat layout without a focus change when the keyboard popes up.
This is what the Layout looks like when the activity starts
This is what happens when the user clicks to the Big Text EditText
This is what I want the layout to look like, the positions should stand in the same way as before, but it should be possible to scroll to the bottom with the keyboard open
The rootView of my layout is
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
I also try to add android:windowSoftInputMode="adjustResize" and android:windowSoftInputMode="adjustPan" the the activity in the Manifest.xml but it does not solve my problem.

Issue in Android Layout - SoftKeyboard - Layout alignment

Hello Am working on some layout design in Android.
Layout contains an EditText inside Relativelayout and alignparentBottom='true' is given to Relativelayout.
When Soft-keyboard opens, My Views remains same - this is okay.
But, The Relativelayout which is inside bottom in screen : which contains EditText is not coming upper side of my SoftKeyboard.
So far, I have done as below to solve but getting an issue explained above: (with adjustPan, my bottom layout is coming upperside of softkeyboard but, it also scrolls the whole screen upper.)
In Manifeast :
android:windowSoftInputMode="adjustResize"
<activity
android:windowSoftInputMode="adjustResize"
android:name=".MyActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="Camera Activity"
android:screenOrientation="portrait" />
What might be the solution?
thanks.
Try using ScrollView as parent view:
<ScrollView
android:id="#+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent">
and remember that scrollview accepts only one direct child, so wrap your whole layout inside it.
also use linearLayout insted of relativeLayout, something like this:
<ScrollView>
<LinearLayout orientation="vertical">
<LinearLayout orientation="vertical">
<EditTexts />
</LinearLayout>
<Button />
</LinearLayout>

Stop softkey from pushing toolbar above screen

My layout looks something like this
<LinearLayout>
<Toolbar/>
<Scrollview>
<More views including a edittext in the bottom/>
</Scrollview>
</LinearLayout>
The problem is that whenever I select the editext to type something the softkey pushes the edittext up, which is how it's supposed to work but the entire layout is pushed up along with it.. I want to keep the toolbar on the screen, just like how it is in WhatsApp where the toolbar remains on the screen when the edittext is pushed up and down by the softkey.
just set
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="false">
and also add this in your linearlayout
android:windowSoftInputMode="adjustPan"

How to stop a textview pushing layout off of screen

I am building a app and I just need some help with the attached screen shot.
Currently I have 5 Plain Textfields with the last 2 being textMultilines. I have a Relativelayout with a button placed at the bottom for the user to press submit. The problem is when the textViews above are filled in, especially the multiline ones, it will push the Relativelayout and button off the screen.
How can I stop this from happening
Picture of layout
Either You should fix the height of multi lines text or you can simply use Scroll View and put all the text view and button in same relative layout
You can make them Scrollable by adding ScrollView around them.
like
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
//all your views here
</LinearLayout>
</ScrollView>

Layout not pushed up when Soft keyboard appears

I have a fragment of this given layout hierarchy,
Inside the view pager I have a Edit text. When keyboard appears to type in the text to EditText the entire layout is not pushed up. Instead the contents inside ViewPager is pushed up. I want the entire content inside the Outer Linear Layout to be pushed up when keyboard appears.
How can I achieve this?
Thanks.
Put your Parent LinearLayout inside a scrollview. This fixed my issue.
put your base layout inside the ScrollView
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/llPlayersName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
// do here the layout work
</LinearLayout>
</ScrollView>
remember scrollView cannon be used as the base layout, so you have to put the scrollView inside the LinearLayout or RelativeLayout.
In your activity's manifest entry, add
<activity ...
android:windowSoftInputMode="adjustPan">

Categories

Resources