java - Android ScrollView Icons -


i developing app using scroll view have problem. first button not visible entirely when scroll top here xml , image app.i have tried different different ways fix not possible ://(in image can see first button not visible part of visible)

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="@mipmap/background">      <scrollview         android:id="@+id/scrollview1"         android:layout_width="100dp"         android:layout_height="280dp"         android:layout_centervertical="true"         android:layout_centerhorizontal="true">          <linearlayout             android:id="@+id/linearlayout1"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_gravity="center"             android:orientation="vertical">              <button                 android:id="@+id/button1"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:background="@mipmap/angle" />             <button                 android:id="@+id/button2"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:background="@mipmap/currency" />             <button                 android:id="@+id/button3"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:layout_centerinparent="true"                 android:background="@mipmap/area" />             <button                 android:id="@+id/datasize"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:background="@mipmap/datasize" />         </linearlayout>      </scrollview>  </relativelayout> 

as can see there button in top lower part visible

this code works me: removing android:layout_gravity="center" linearlayout

    <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="@mipmap/background">      <scrollview         android:id="@+id/scrollview1"         android:layout_width="100dp"         android:layout_height="280dp"         android:layout_centervertical="true"         android:layout_centerhorizontal="true">          <linearlayout             android:id="@+id/linearlayout1"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:orientation="vertical">              <button                 android:id="@+id/button1"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:background="@mipmap/angle" />             <button                 android:id="@+id/button2"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:background="@mipmap/currency" />             <button                 android:id="@+id/button3"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:layout_centerinparent="true"                 android:background="@mipmap/area" />             <button                 android:id="@+id/datasize"                 android:layout_width="100dp"                 android:layout_height="100dp"                 android:background="@mipmap/datasize" />         </linearlayout>      </scrollview>  </relativelayout> 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -