I’m using this layout in one of my applications. I don’t know why it is getting distorted. The main issue is that in all the three LinearLayout blocks, only the first TextView is displayed on the screen and in place of the TextViews following that, a big blank space is displayed.
The snapshot of the image being displayed is Snapshot…
Layout.xml
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5sp" >
<LinearLayout
android:id="@+id/ll_images"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:padding="10sp" >
<ImageView
android:id="@+id/certification_image"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:contentDescription="@string/details_image"
android:visibility="gone" />
<ImageView
android:id="@+id/image_details_page"
android:layout_width="100sp"
android:layout_height="100sp"
android:contentDescription="@string/details_image" />
</LinearLayout>
<TextView
android:id="@+id/details_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/ll_images"
android:padding="10sp"
android:textColor="#040404"
android:textSize="25sp"
android:textStyle="bold"
android:typeface="sans" />
<TextView
android:id="@+id/details_tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/details_name"
android:layout_toLeftOf="@id/ll_images"
android:paddingLeft="5sp"
android:textColor="#343434"
android:textSize="15sp"
android:typeface="sans" />
<LinearLayout
android:id="@+id/ll_facts"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_images">
<TextView
android:id="@+id/tv_facts"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/gradient_bg"
android:padding="10sp"
android:text="Facts"
android:textColor="@android:color/darker_gray"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/details_tv2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5sp"
android:textSize="15sp"
android:text="@string/test" />
<TextView
android:id="@+id/details_tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5sp"
android:text="@string/test"
android:textSize="15sp" />
<TextView
android:id="@+id/details_tv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5sp"
android:text="@string/test"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_foundation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_facts">
<TextView
android:id="@+id/tv_foundation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/gradient_bg"
android:padding="10sp"
android:text="Foundation Statement"
android:textColor="@android:color/darker_gray"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/details_tv5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5sp"
android:textColor="#343434"
android:text="@string/test"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_overview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_foundation">
<TextView
android:id="@+id/tv_overview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/gradient_bg"
android:padding="10sp"
android:text="Overview"
android:textColor="@android:color/darker_gray"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/details_tv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/test"
android:paddingLeft="5sp"
android:textColor="#343434"
android:textSize="15sp" />
</LinearLayout>
<Button
android:id="@+id/btnViewScorecard"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_overview"
android:layout_margin="5sp"
android:background="@drawable/search_button"
android:paddingLeft="10sp"
android:text="@string/ViewScorecard"
android:textColor="#FFFFFF"
android:typeface="sans"
android:visibility="gone"/>
</RelativeLayout>
Any help would be really appreciated. Thanks in advance!!!
Finally I have figured it out… All I had to do was I had to add the following line to my
LinearLayout.Thanks all for the help…