Android ScrollView content disappearing on removing background attribute -


i have scrollview in linearlayout along header linearlayout on top. have given main linearlayout background. if keep background scrollview displays fine. if add lot of content scrollview background stretches. want keep scrollview transparent.

but if remove background attribute or if try android:background="@android:color/transparent" content inside scrollview vanishes. can see header , background outer linearlayouts.

this how want views:

<linear layout background image>   <header linear layout>   </header linear layout>   <scrollview no background>     <layouts in scroll view>   </scrollview> 

here code:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="@drawable/bg"     android:orientation="vertical" >      <include layout="@layout/topbar" />      <scrollview         android:layout_width="fill_parent"         android:layout_height="fill_parent" >          <linearlayout             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:orientation="vertical" >              <textview                 style="@style/labels"                 android:text="@string/posts_add_postcontent" />              <edittext                 android:id="@+id/postsaddcontent"                 android:layout_width="fill_parent"                 android:layout_height="wrap_content"                 android:hint="@string/posts_add_postcontent_h"                 android:inputtype="textmultiline"                 android:maxlength="3000"                 android:minlines="3" />         </linearlayout>     </scrollview>  </linearlayout> 

note: header linearlayout included via file:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical" >      <relativelayout         android:id="@+id/topbar"         android:layout_width="fill_parent"         android:layout_height="30dip"         android:background="@layout/bgtop_repeat"         android:orientation="horizontal"         android:paddingtop="2dip" >          <imageview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:contentdescription="@string/app_name"             android:src="@drawable/cornerlogo" />          <button             android:id="@+id/menubuton"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparentright="true"             android:background="@drawable/menubutton" />     </relativelayout>      <linearlayout         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:background="@layout/headshadow_repeat"         android:orientation="horizontal" />  </linearlayout> 

thanks in advance :)

try

android:layout_height="wrap_content" 

in included layout


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -