Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll View doesn't show full content

I have an XML file that has a ScrollView with one child LinearLayout. in tried to inflate a layout which has a TableLayout and some other child views. but for some reason that last button in the tableTable layout is not fully visible.

Update:- For trial i moved the button up..but the same happened to the last textView..so i can get from that the problem is either with ScrollView-LinearLayout or TableLayout.

MYScrollView.xml

          <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="15dp"
android:fillViewport="true"
android:scrollbars="none"
tools:context=".MainActivity" >

<LinearLayout
    android:id="@+id/lo1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/border"   
    android:animateLayoutChanges="true"
    android:orientation="vertical" >

  </LinearLayout>
</ScrollView>

MyTableLayout.xml

 <?xml version="1.0" encoding="utf-8"?>
   <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LiLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left">

<com.example.tamarud.FontTextView
    android:id="@+id/textv"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:gravity="center"
    android:text="La campagne Rebelle"
    android:textColor="#611711" />

<com.example.tamarud.Header2
    android:id="@+id/TextView01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:text="(Pour la destitution de Mohamed Mursi Al Ayat)" />

<LinearLayout
    android:id="@+id/LinearLayout2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="20dp" >

    <com.example.tamarud.Bodytext
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="left"
        android:text="• Parce que la sécurité n'a pas été retrouvée à Ce jour … On vous refuse" />

    <com.example.tamarud.Bodytext
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="left"
        android:text="• Parce que le démunis est toujours ignoré … On vous refuse" />

    <com.example.tamarud.Bodytext
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="left"
        android:text="• Parce que nous sommes encore en train de mendier des prêts de l'extérieur … On vous refuse" />
      <TableRow
        android:id="@+id/LinearLayout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"             
        android:layout_marginTop="5dip"
        android:layout_marginBottom="5dip">

    <com.example.tamarud.Bodytext
            android:layout_width="0dip"
            android:layout_weight="1"
            android:layout_height="wrap_content"
        android:background="#611711"
        android:paddingBottom="10dp"
        android:paddingLeft="15dp"
        android:paddingRight="15dp"
        android:paddingTop="10dp"
        android:text="Quartier"
        android:textColor="#FFFFFF"/>

    <Spinner
        android:id="@+id/spinner01"
            android:layout_width="0dip"
            android:layout_weight="2"
            android:layout_height="wrap_content" />
</TableRow>

<TableRow
        android:id="@+id/LinearLayout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"             
        android:layout_marginTop="5dip"
        android:layout_marginBottom="5dip">

    <com.example.tamarud.Bodytext
            android:layout_width="0dip"
            android:layout_weight="1"
            android:layout_height="wrap_content"
        android:background="#611711"
        android:paddingBottom="10dp"
        android:paddingLeft="15dp"
        android:paddingRight="15dp"
        android:paddingTop="10dp"
        android:text="E-mail"
        android:textColor="#FFFFFF" />

    <EditText
        android:id="@+id/EditText07"
            android:layout_width="0dip"
            android:layout_weight="2"
            android:layout_height="wrap_content"
        android:gravity="left"
        android:hint="Entrez E-mail"
        android:imeOptions="actionNext"
        android:textColor="#000000" />
  </TableRow>
</LinearLayout>
<Button
    android:id="@+id/submit"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="50dp"
    android:layout_marginRight="50dp"
    android:layout_marginTop="5dp"
    android:background="#611711"
    android:paddingBottom="10dp"
    android:paddingLeft="15dp"
    android:paddingRight="15dp"
    android:paddingTop="10dp"
    android:text="I Accept"
    android:textColor="#FFFFFF"
    android:textSize="25sp" />

   </TableLayout>

here is a picture

like image 685
Mo Adel Avatar asked Dec 13 '25 23:12

Mo Adel


1 Answers

The only solution is to wrap the ScrollView in a RelativeLayout and give them both Width and Height of fill_parent

like image 140
Mo Adel Avatar answered Dec 16 '25 12:12

Mo Adel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!