Tecnologia do Blogger.
RSS

[androidbrasil-dev] Re: Teclado sobrepondo editText

Esqueci de informar, usando as tabs da antiga actionBar, funciona legal no lollipop.
Por isso acho que deve haver uma forma de fazer funcionar com toolBar + tabLayout no lollipop

Em qui, 17 de set de 2015 às 11:34, Jean Santiago <jeansantiago00@gmail.com> escreveu:
Puts, as imagens ficaram grande demais. Me desculpem.

Em qui, 17 de set de 2015 às 11:31, Jean Santiago <jeansantiago00@gmail.com> escreveu:
Galera,
Demorei mas migrei minhas tabs da antiga actionbar para toolbar + tablayout. Mas estou com um problema em relação ao teclado sobrepondo o edittext.
Quando usava tab da actionBar funcionava legal.
Esse módulo abaixo ainda não migrei, ainda uso as tabs da actionBar:

Quando clico no último editText, o scrollView funciona como gostaria (fiz o desenho da barra de rolagem :p):
device-2015-09-17-105448_091715_105956_AM.jpg
Agora com toolbar + tabLayout isso não funciona. O teclado sobrepõe o editText.
Até segui algumas dicas como essa. Funcionou mas o comportamento é estranho. Fica assim:

ao selecionar o último editText:
Ele eleva todo o bloco pra cima e a toolBar e tabLayout não aparecem.
Isso resolve o problema, mas eu queria mesmo era deixar assim:

Essa forma aí desse último print fiz sem usar o android:windowSoftInputMode="adjustPan" no manifest, e sem o android:isScrollContainer="false" no scrollView. Coloquei android:layout_weight="1" no scrollView mas não funcionou no Lollipop.

Layout da activity:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/AppTheme.ActionBar"
app:popupTheme="@style/AppTheme.ActionBar" />

<android.support.design.widget.TabLayout
android:id="@+id/silver_main_tab_layout"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabIndicatorColor="@android:color/white"
app:tabMaxWidth="0dp"
app:tabMode="scrollable" />

<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
Layout de um dos fragments
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:orientation="vertical">
         ...

Alguma dica além dessa de usar android:windowSoftInputMode="adjustPan" junto com android:isScrollContainer="false"?

Obrigado.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário