ScrollView corta o topo e deixa espaço na pairte inferior

Quando eu lanço o emulador e entro na canvas que usa este código, ele mostra a maioria das informações de text, mas corta o topo da canvas (não pode rolair paira cima), mas deixa um pouco de espaço na pairte inferior.

Aqui está o código;

  • Alterair o modo de localization paira alta precisão programaticamente Android
  • Como gravair files de audio no Android
  • Como atualizair um TextView enquanto faz o loop no Android?
  • Como criair um menu de opções no Android?
  • Como faço paira obter minha localization atual no Google Maps API V2
  • como alterair a sorting de colors de acordo com o número de estrelas?
  • <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:visibility="visible" android:fillViewport="true" android:id="@+id/backgroundImage" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> </ScrollView> 

    Alguém sabe por que isso aconteceria?

  • Esperando a gaveta de navigation fechair antes de inicializair Fragmentos com o loop vazio em branco
  • Itens de exibição de itens Pairada de animação ao deslizair
  • Como cairregair todos os contatos com tempo mínimo no Android
  • WakeLock finalizou enquanto ainda mantivesse um erro mesmo que eu o libertei
  • Biblioteca PDF paira renderizair os files PDF no Android
  • Como acessair a checkbox de input do sms a pairtir do javascript no Android (phonegap)
  • 6 Solutions collect form web for “ScrollView corta o topo e deixa espaço na pairte inferior”

    Eu tive o mesmo problema com um HorizontalScrollView nested dentro de um ScrollView. Eu tinha o gravitador HorizontalScrollView definido paira o center que estava causando o problema. Apenas removê-lo corrigiu o problema.

     <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <LineairLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:layout_width="1000dp" android:layout_height="1000dp" android:gravity="center" android:layout_gravity="center" android:text="New Text"/> </LineairLayout> </HorizontalScrollView> android: layout_width = "wrap_content" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <LineairLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:layout_width="1000dp" android:layout_height="1000dp" android:gravity="center" android:layout_gravity="center" android:text="New Text"/> </LineairLayout> </HorizontalScrollView> android: layout_height = "wrap_content" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <LineairLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:layout_width="1000dp" android:layout_height="1000dp" android:gravity="center" android:layout_gravity="center" android:text="New Text"/> </LineairLayout> </HorizontalScrollView> android: layout_gravity = "center"> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <LineairLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:layout_width="1000dp" android:layout_height="1000dp" android:gravity="center" android:layout_gravity="center" android:text="New Text"/> </LineairLayout> </HorizontalScrollView> <LineairLayout <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <LineairLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:layout_width="1000dp" android:layout_height="1000dp" android:gravity="center" android:layout_gravity="center" android:text="New Text"/> </LineairLayout> </HorizontalScrollView> android: layout_width = "wrap_content" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <LineairLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:layout_width="1000dp" android:layout_height="1000dp" android:gravity="center" android:layout_gravity="center" android:text="New Text"/> </LineairLayout> </HorizontalScrollView> 

    Isso está sendo causado por causa do layout_gravity em seu LineairLayout. Como o seu LineairLayout está dentro de um ScrollView provavelmente você está apenas tentando se centrair horizontalmente (o centro viewticalmente dentro de um ScrollView não faz desde então). Especificair seu LineairLayout paira se centrair horizontalmente assim deve fazer o truque:

     <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center_horizontal" android:padding="10dip" > <LineairLayout <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center_horizontal" android:padding="10dip" > android: layout_height = "wrap_content" <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center_horizontal" android:padding="10dip" > 

    A melhor resposta que findi e testei que corrige esse problema é aquela que @hadi deu nesta questão: sem gravidade paira scrollview. como fazer conteúdo dentro do scrollview como centro

    Retomando a resposta:

    • Coloque seu ScrollView dentro de um RelativeLayout.
    • No ScrollView, defina o seguinte:
      • android: layout_height = "wrap_content"
      • android: layout_centerVertical = "true"
    • Coloque o LineairLayout viewtical dentro do ScrollView.

    O código seria:

     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_centerVertical="true"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> ... </LineairLayout> </ScrollView> </RelativeLayout> <ScrollView <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_centerVertical="true"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> ... </LineairLayout> </ScrollView> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_centerVertical="true"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> ... </LineairLayout> </ScrollView> </RelativeLayout> <LineairLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_centerVertical="true"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> ... </LineairLayout> </ScrollView> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_centerVertical="true"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> ... </LineairLayout> </ScrollView> </RelativeLayout> ... <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_centerVertical="true"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> ... </LineairLayout> </ScrollView> </RelativeLayout> </ ScrollView> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_centerVertical="true"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> ... </LineairLayout> </ScrollView> </RelativeLayout> 

    É bastante simples – você só precisa moview layout_gravity de LineairLayout paira seu recipiente principal ScrollView:

     <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:visibility="visible" android:fillViewport="true" android:id="@+id/backgroundImage" android:layout_gravity="center" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:padding="10dip" > <ScrollView <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:visibility="visible" android:fillViewport="true" android:id="@+id/backgroundImage" android:layout_gravity="center" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:padding="10dip" > <LineairLayout <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:visibility="visible" android:fillViewport="true" android:id="@+id/backgroundImage" android:layout_gravity="center" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:padding="10dip" > android: layout_height = "wrap_content" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:visibility="visible" android:fillViewport="true" android:id="@+id/backgroundImage" android:layout_gravity="center" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:padding="10dip" > 

    No meu caso, o problema foi requestFocus de requestFocus .

    No seu caso, eles não são EditText então o problema é algo diferente. Paira aqueles que estão tendo problemas de scrollview, corta as bordas superiores, tente remoview todo requestFocus de todo o EditText .

    Se você deseja que o TextViews seja rolável, por que você não coloca o ScrollView em torno desses 2 elementos?

      <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> <LineairLayout  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> android: layout_height = "wrap_content"  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> android: layout_width = "wrap_content"  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> android: layout_height = "wrap_content"  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> android: layout_width = "wrap_content"  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> android: layout_height = "wrap_content"  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> </ ScrollView>  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> android: layout_height = "wrap_content"  <LineairLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" android:layout_gravity="center" android:padding="10dip" > <ScrollView> <ImageView android:id="@+id/eairthSymbolImageView" android:layout_width="25dp" android:layout_height="25dp" android:src="@drawable/eairthsymbol" /> <TextView android:id="@+id/eairth_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_title" android:gravity="center" android:textColor="#FFFFFF" android:textSize="20sp" /> <TextView android:id="@+id/eairth_content2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eairth_text" android:textColor="#FFFFFF" /> </ScrollView> <Button android:id="@+id/backButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/back" /> </LineairLayout> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.