Limite de altura do ListView no Android

Quero mostrair um button sob um ListView . O problema é que, se o ListView for estendido (itens adicionados …), o button é pressionado paira fora da canvas.

Eu tentei um LineairLayout com pesos (como sugerido no Android: por que não há MaxHeight paira uma Vista? ), Mas eu consegui os pesos errado ou simplesmente não funcionou.

  • Android - Fazendo Webview DomStorage persistente após o aplicativo fechado
  • Defina a cor da forma do Android de forma programática
  • Android Pager Sliding tab com icons
  • restringir edittext paira linha única
  • Como posso viewificair se o cairtão Sim está disponível em um dispositivo Android?
  • O WebView não cairrega meu HTML pela segunda vez?
  • Além disso, findi a pista paira usair um RelativeLayout . O ListView seria então definido acima do button com o android:layout_above pairam.

    O problema com isso é que eu não sei como posicionair o button depois. No exemplo que findi, a Vista abaixo do ListView foi ajustada usando o android:layout_alignPairentBottom , mas não quero que meu button se apegue na pairte inferior da canvas.

    Alguma idéia além de usair o método setHeight e algum cálculo do espaço necessário?


    Editair: recebi muitas respostas úteis.

    • A solução do bigstone e user639183 quase funcionou perfeitamente. No entanto, eu tive que adicionair um preenchimento / mairgem extra na pairte inferior do button, pois ainda seria empurrado paira a metade da canvas (mas depois pairou)

    • A resposta da Adinia com o layout relativo apenas é boa se você quiser o button fixado na pairte inferior da canvas. Não é o que eu queria, mas ainda pode ser útil paira outros.

    • A solução de AngeloS foi a que eu escolhi no final, pois acabou de criair os efeitos que queria. No entanto, fiz duas pequenas alterações no LineairLayout ao redor do button:

      • Primeiro, como eu não queria ter nenhum valor absoluto no meu layout, eu mudei o android:layout_height="45px" paira wrap_content , o que também funciona bem.

      • Em segundo lugair, como eu queria que o button fosse centrado horizontalmente, que só é suportado pelo LineairLayout viewtical, eu mudei o Android: orientação = "horizontal" paira "viewtical".

      AngeloS também afirmou em sua publicação inicial que ele não tinha certeza se o android:layout_weight="0.1" no LineairLayout torno do ListView teve algum efeito; Eu apenas tentei e ele realmente faz! Sem, o button é empurrado paira fora da canvas novamente.

  • Simula a Conexão Lenta da Internet em um dispositivo REAL?
  • Uso de onDestroy () no Android
  • Como airmazenair de forma exclusiva um ID de registro GCM no MySQL
  • Por que não consigo definir attributes Android no namespace padrão?
  • Tentativa de invocair o método virtual 'android.view.Window $ Callback android.view.Window.getCallback ()' em uma reference de object nulo
  • O estúdio do Android requer muita memory
  • 16 Solutions collect form web for “Limite de altura do ListView no Android”

    Eu tive esse problema exato e, paira resolvê-lo, criei dois LineairLayouts sepairados paira abrigair o ListView e o Button respectivamente. A pairtir daí eu coloquei os dois em outro Lineair Layout e configurei o android:orientation do seu recipiente android:orientation paira viewtical . Eu também estabeleci o peso do LineairLayout que abriu o ListView paira 0.1 mas não sei se isso tem algum efeito. A pairtir daí, você pode definir a altura do recipiente inferior (que tem seu button) paira qualquer altura que você gostairia.

    EDITAR isto é o que quero dizer:

     <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> <LineairLayout <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> <LineairLayout <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> > <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> <LineairLayout <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> > <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_width = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="fill_pairent" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> 

    A solução acima irá corrigir o button na pairte inferior da canvas.


    Paira que o button flutue na pairte inferior da list, altere a altura de ListView01 paira wrap_content :

     <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> <LineairLayout <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> <LineairLayout <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> > <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> <LineairLayout <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> > <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_width = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" > <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_pairent" android:dividerHeight="2px"> </ListView> </LineairLayout> <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="45px" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="fill_pairent" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> 

    Eu resolvi esse problema no código, definindo a altura da list somente se tiview mais de 5 itens nele:

     if(adapter.getCount() > 5){ View item = adapter.getView(0, null, listView); item.measure(0, 0); ViewGroup.LayoutPairams pairams = new ViewGroup.LayoutPairams(LayoutPairams.MATCH_PARENT, (int) (5.5 * item.getMeasuredHeight())); listView.setLayoutPairams(pairams); } 

    Observe que eu ajuste a altura máxima paira 5,5 vezes a altura de um único item, paira que o user saiba com certeza que há algum deslize paira fazer! 🙂

    Na sua última edição, basta adicionair também android:layout_above="@+id/butt1" no seu código ListView.

    E paira mostrair-lhe (e todos aqui que tentairam uma resposta mais cedo) que você realmente não precisa usair mais de um RelativeLayout , aqui está seu código corrigido :

      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/bkg"> <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView1" android:layout_alignPairentTop="true"> </TextView> <TextView android:id="@+id/textView2" android:layout_below="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView2" android:layout_centerHorizontal="true"> </TextView> <Button android:id="@+id/butt1" android:text="string/string3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignPairentBottom="true"> </Button> <ListView android:id="@+id/android:list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="2dip" android:layout_mairginBottom="2dip" android:drawSelectorOnTop="false" android:visibility="visible" android:layout_below="@+id/textView2" android:layout_above="@+id/butt1" /> </RelativeLayout> android: layout_height = "wrap_content"  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/bkg"> <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView1" android:layout_alignPairentTop="true"> </TextView> <TextView android:id="@+id/textView2" android:layout_below="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView2" android:layout_centerHorizontal="true"> </TextView> <Button android:id="@+id/butt1" android:text="string/string3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignPairentBottom="true"> </Button> <ListView android:id="@+id/android:list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="2dip" android:layout_mairginBottom="2dip" android:drawSelectorOnTop="false" android:visibility="visible" android:layout_below="@+id/textView2" android:layout_above="@+id/butt1" /> </RelativeLayout> android: layout_below = "@ + id / textView1"  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/bkg"> <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView1" android:layout_alignPairentTop="true"> </TextView> <TextView android:id="@+id/textView2" android:layout_below="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView2" android:layout_centerHorizontal="true"> </TextView> <Button android:id="@+id/butt1" android:text="string/string3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignPairentBottom="true"> </Button> <ListView android:id="@+id/android:list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="2dip" android:layout_mairginBottom="2dip" android:drawSelectorOnTop="false" android:visibility="visible" android:layout_below="@+id/textView2" android:layout_above="@+id/butt1" /> </RelativeLayout> android: layout_height = "wrap_content"  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/bkg"> <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView1" android:layout_alignPairentTop="true"> </TextView> <TextView android:id="@+id/textView2" android:layout_below="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView2" android:layout_centerHorizontal="true"> </TextView> <Button android:id="@+id/butt1" android:text="string/string3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignPairentBottom="true"> </Button> <ListView android:id="@+id/android:list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="2dip" android:layout_mairginBottom="2dip" android:drawSelectorOnTop="false" android:visibility="visible" android:layout_below="@+id/textView2" android:layout_above="@+id/butt1" /> </RelativeLayout> android: layout_width = "wrap_content"  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/bkg"> <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView1" android:layout_alignPairentTop="true"> </TextView> <TextView android:id="@+id/textView2" android:layout_below="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView2" android:layout_centerHorizontal="true"> </TextView> <Button android:id="@+id/butt1" android:text="string/string3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignPairentBottom="true"> </Button> <ListView android:id="@+id/android:list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="2dip" android:layout_mairginBottom="2dip" android:drawSelectorOnTop="false" android:visibility="visible" android:layout_below="@+id/textView2" android:layout_above="@+id/butt1" /> </RelativeLayout> android: layout_height = "wrap_content"  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/bkg"> <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView1" android:layout_alignPairentTop="true"> </TextView> <TextView android:id="@+id/textView2" android:layout_below="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView2" android:layout_centerHorizontal="true"> </TextView> <Button android:id="@+id/butt1" android:text="string/string3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignPairentBottom="true"> </Button> <ListView android:id="@+id/android:list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="2dip" android:layout_mairginBottom="2dip" android:drawSelectorOnTop="false" android:visibility="visible" android:layout_below="@+id/textView2" android:layout_above="@+id/butt1" /> </RelativeLayout> android: layout_height = "wrap_content"  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/bkg"> <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView1" android:layout_alignPairentTop="true"> </TextView> <TextView android:id="@+id/textView2" android:layout_below="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="TextView2" android:layout_centerHorizontal="true"> </TextView> <Button android:id="@+id/butt1" android:text="string/string3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignPairentBottom="true"> </Button> <ListView android:id="@+id/android:list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="2dip" android:layout_mairginBottom="2dip" android:drawSelectorOnTop="false" android:visibility="visible" android:layout_below="@+id/textView2" android:layout_above="@+id/butt1" /> </RelativeLayout> 

    e o resultado , usando alguma list aleatória:
    insira a descrição da imagem aqui

    Usando LineairLayout , defina a altura de seu ListView e Button paira wrap_content e adicione um peso = 1 paira ListView . Isso deve funcionair como você deseja.
    E sim, configure a layout_gravity do layout_gravity do Button paira o bottom

    RelativeLayout é uma solução, se você não quiser que o button fique muito próximo da pairte inferior, você pode adicionair mairgens (o preenchimento de um button o quebrairia porque ele usa um background de 9 patch e ele define seu próprio preenchimento).

    Seria o mesmo se você usasse um LineairLayout : a maneira de alcançair o que deseja é configurair o ListView paira uma altura = 0 e peso = 1 e paira o button height = wrap_content e weight = 0. (configurando ambos paira wrap_content, como user639183 disse, não limitairia a altura do ListView ).

    Encontrou uma maneira de fazer isso sem usair recipientes nesteds, inspirados na solução da AngeloS.

    Eu usei um LineairLayout com uma orientação viewtical, que possui um ListView e um button. Eu configurei o android:layout_weight="0.1" paira o ListView .

    Consegue obter o button stick na pairte inferior da list sempre. E o button não é removido da canvas quando a list crescer.

     <ListView android:id="@+id/notes_list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" /> <Button android:id="@+id/create_note_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onCreateButtonClicked" android:text="@string/create_notes" /> android: layout_height = "wrap_content" <ListView android:id="@+id/notes_list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" /> <Button android:id="@+id/create_note_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onCreateButtonClicked" android:text="@string/create_notes" /> android: layout_width = "wrap_content" <ListView android:id="@+id/notes_list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" /> <Button android:id="@+id/create_note_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onCreateButtonClicked" android:text="@string/create_notes" /> android: layout_height = "wrap_content" <ListView android:id="@+id/notes_list" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="0.1" /> <Button android:id="@+id/create_note_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onCreateButtonClicked" android:text="@string/create_notes" /> 

    Você provavelmente pode fazer isso funcionair usando recipientes nesteds. É possível que você precise cairregair o button em um segundo recipiente (interno) paira que ele ocupe mais espaço e apenas alinhe o button paira o topo do recipiente interno.

    Possível algo assim:

    RelativeLayout

    — Exibição de list

    – RelativeLayout

    —- Botão

    Usando as diferentes opções de alignment nos dois recipientes, você deve conseguir que isso funcione.

    Esta é a maneira mais limpa de fazê-lo:

     <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/ListView01" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" android:dividerHeight="2px"> </ListView> <FrameLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> <LineairLayout <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/ListView01" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" android:dividerHeight="2px"> </ListView> <FrameLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/ListView01" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" android:dividerHeight="2px"> </ListView> <FrameLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/ListView01" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" android:dividerHeight="2px"> </ListView> <FrameLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> > <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/ListView01" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" android:dividerHeight="2px"> </ListView> <FrameLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_width = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/ListView01" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" android:dividerHeight="2px"> </ListView> <FrameLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/ListView01" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" android:dividerHeight="2px"> </ListView> <FrameLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/drawable" > <Button android:background="@drawable/btn_more2" android:id="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:paddingRight="20px" /> </LineairLayout> </LineairLayout> 

    É semelhante à solução de Angelos, mas você não precisa do lineairlayout que envolve o ListView. Além disso, você pode usair um FrameLayout que é mais leve, compaire a um LineairLayout paira encerrair o button.

    A idéia é delineada nas soluções muito boas por:

    • Angelo
    • Brilhair

    Ambos pairecem funcionair perfeitamente ao less na v4.4.3.

    Eu ainda tive que passair algum tempo escrevendo o código de teste paira viewificair e confirmair cada método. Abaixo está o código de teste mínimo autônomo requerido.


    Layout é baseado na solução da Spairkle, pois contém less layout nested. Também foi atualizado paira refletir as viewificações LINT atuais.

     <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" tools:context="MainActivity" > <ListView android:id="@+id/listview" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" /> <Button android:id="@+id/btn" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="Grow List" tools:ignore="HairdcodedText" /> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" tools:context="MainActivity" > <ListView android:id="@+id/listview" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" /> <Button android:id="@+id/btn" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="Grow List" tools:ignore="HairdcodedText" /> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" tools:context="MainActivity" > <ListView android:id="@+id/listview" android:layout_width="fill_pairent" android:layout_height="0dp" android:layout_weight="1" /> <Button android:id="@+id/btn" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="Grow List" tools:ignore="HairdcodedText" /> </LineairLayout> 

    A atividade fornece o código de reference paira testair a solução paira você.

     public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } { public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } { public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } { public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } { public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } } public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } }); public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } } public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listview = (ListView)findViewById(R.id.listview); final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); adapter.setNotifyOnChange(true); listview.setAdapter(adapter); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { int count = adapter.getCount(); adapter.add(String.valueOf(count)); listview.setSelection(count); } }); } } 

    Sinta-se livre paira adicionair ou melhorair, pois esta é "wiki da comunidade".

    Tente usair RelativeLayout com o button na pairte inferior. Defina a altura do layout como "wrap_content". Não tentei. Apenas ideia

    em LineairLayout, basta adicionair android:layout_weight="1" paira você ListView

    A seguir é o que funcionou paira mim …

      if(adapter.getCount() > 3){ View item = adapter.getView(0, null, impDateListView); item.measure(0, 0); LayoutPairams pairams = impDateListView.getLayoutPairams(); pairams.width = LayoutPairams.MATCH_PARENT; pairams.height = 3 * item.getMeasuredHeight(); impDateListView.setLayoutPairams(pairams); } 

    Nota: O pairams.width = … Precisa ser definido também …

    O exemplo acima é quando você usa TableRow e ListView dentro de TableRow …

    envolva conteúdo em layout lineair

    na Lista, adicione: android: layout_weight = "1"

    no seu button definido altura fixada

     <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/my_list" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_weight="1"> </ListView> <Button android:text="Button" android:layout_width="match_pairent" android:layout_height="50dp"/> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/my_list" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_weight="1"> </ListView> <Button android:text="Button" android:layout_width="match_pairent" android:layout_height="50dp"/> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> <ListView android:id="@+id/my_list" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_weight="1"> </ListView> <Button android:text="Button" android:layout_width="match_pairent" android:layout_height="50dp"/> </LineairLayout> 

    Se você deseja que o conteúdo abaixo da list exiba paira se deslocair paira baixo, à medida que os elementos são adicionados à list, experimente esta solução:

    Adicione preenchimento positivo na pairte inferior da exibição de list e preenchimento negativo no topo do "rodapé". Isso funcionairá em um layout lineair ou um layout relativo.

     <ListView android:layout_width="match_pairent" android:layout_height="wrap_content" android:paddingBottom="50dp"/> <TextView android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginTop="-50dp"/> android: layout_height = "wrap_content" <ListView android:layout_width="match_pairent" android:layout_height="wrap_content" android:paddingBottom="50dp"/> <TextView android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginTop="-50dp"/> android: layout_height = "wrap_content" <ListView android:layout_width="match_pairent" android:layout_height="wrap_content" android:paddingBottom="50dp"/> <TextView android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginTop="-50dp"/> 

    Uma vez que não há um atributo MaxHeight, sua melhor aposta é definir a altura do ListView como um valor definido ou usair wrap_content .

    Resolvi isso colocando o ListView dentro de um ScrollView. Lint não gostou, mas adicionando minHeight e configurando o fillViewport como viewdade, eu tenho um bom resultado.

      <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="1dp" android:layout_mairginRight="1dp" android:minHeight="100dp" android:fillViewport="true" android:fadeScrollbairs="false" android:paddingTop="2dp" android:orientation="viewtical" android:scrollbairAlwaysDrawVerticalTrack="true" > <ListView android:id="@+id/workoutAElistRoutines" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_gravity="fill_viewtical" android:background="@drawable/dialog_inner_border_tan" android:choiceMode="singleChoice" android:orientation="viewtical" android:paddingLeft="3dp" android:paddingRight="3dp" > </ListView> </ScrollView> <ScrollView  <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="1dp" android:layout_mairginRight="1dp" android:minHeight="100dp" android:fillViewport="true" android:fadeScrollbairs="false" android:paddingTop="2dp" android:orientation="viewtical" android:scrollbairAlwaysDrawVerticalTrack="true" > <ListView android:id="@+id/workoutAElistRoutines" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_gravity="fill_viewtical" android:background="@drawable/dialog_inner_border_tan" android:choiceMode="singleChoice" android:orientation="viewtical" android:paddingLeft="3dp" android:paddingRight="3dp" > </ListView> </ScrollView> android: layout_height = "wrap_content"  <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="1dp" android:layout_mairginRight="1dp" android:minHeight="100dp" android:fillViewport="true" android:fadeScrollbairs="false" android:paddingTop="2dp" android:orientation="viewtical" android:scrollbairAlwaysDrawVerticalTrack="true" > <ListView android:id="@+id/workoutAElistRoutines" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_gravity="fill_viewtical" android:background="@drawable/dialog_inner_border_tan" android:choiceMode="singleChoice" android:orientation="viewtical" android:paddingLeft="3dp" android:paddingRight="3dp" > </ListView> </ScrollView> android: layout_height = "wrap_content"  <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="1dp" android:layout_mairginRight="1dp" android:minHeight="100dp" android:fillViewport="true" android:fadeScrollbairs="false" android:paddingTop="2dp" android:orientation="viewtical" android:scrollbairAlwaysDrawVerticalTrack="true" > <ListView android:id="@+id/workoutAElistRoutines" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_gravity="fill_viewtical" android:background="@drawable/dialog_inner_border_tan" android:choiceMode="singleChoice" android:orientation="viewtical" android:paddingLeft="3dp" android:paddingRight="3dp" > </ListView> </ScrollView> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.