1

Well friend ..

I have a design so:
enter image description here
The main Scroll is very necessary when appear the keyboard... If i dont make that, the button can't see... The problem is when i try move inside the Edittext with the keyboard active... I tried this:

android:scrollbars="vertical"

and this:

setMovementMethod(new ScrollingMovementMethod());

but not solve this yet Anyone help me? grax advance!

Roldanhollow
  • 105
  • 5
  • 16

2 Answers2

0
Check this without using scroll bar:
add permission in menifest file for corresponding activity.
android:windowSoftInputMode="adjustPan"
d.k.
  • 415
  • 4
  • 16
0

Please try this:

Your layout should be similar to example:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/edittext"
        android:layout_width="200dp"
        android:layout_height="500dp"
        android:text="some long text"

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />
</LinearLayout>

</ScrollView>

and in your java try this:

EditText edit = (EditText)findViewById(R.id.edittext);
edit.setOnTouchListener(new OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        if (v.getId() == R.id.edittext) {
            v.getParent().requestDisallowInterceptTouchEvent(true);
            switch (event.getAction() & MotionEvent.ACTION_MASK) {
            case MotionEvent.ACTION_UP:
                v.getParent().requestDisallowInterceptTouchEvent(false);
                break;
            }
        }
        return false;
    }
});

It could be helpful.

Community
  • 1
  • 1
mamakurka
  • 480
  • 1
  • 4
  • 14
  • And how can mantain a linearlayout with buttons for example: Bold, italic style Evernote when the cel is in landscape? – Roldanhollow Oct 22 '13 at 03:45
  • Please specify what you exactly want do and how you try do it. The easiest way will be if you update your question description or add new question. Generally for Evernote style you can find information there: http://stackoverflow.com/questions/10294064/android-evernote-style-layout and for screen orientation: http://stackoverflow.com/questions/151777/saving-activity-state-in-android – mamakurka Oct 22 '13 at 10:22