Pregunta

I have created a custom keyboard for my android application. I have also disabled the default android keyboard. I display the keyboard as a fragment in the activity and it shows up well.

I only cannot get activity view to push above when the keyboard shows up. Is there any way that I could do this?

XML FILE

<FrameLayout
        android:id="@+id/flKeyboard"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />

SHOW FRAGMENT

FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.add(R.id.flKeyboard, new Keyboard()).commit();
¿Fue útil?

Solución 2

I'm not sure if this is the correct way, but I've used a translate animation, to move the view along the Y-axis. With some tweaking , it actually looks better than the default android push.

Otros consejos

You can try something like this:

<RelativeLayout>  
<View
    android:id="@+id/myView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
 />  
<FrameLayout
        android:id="@+id/flKeyboard"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/myView"
/>

</RelativeLayout>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top