java - Image and Text View errors on Android XML -


https://lh4.googleusercontent.com/hn3fw3mfqlcokpsqmrvb2dzkmo4fgpsrrsikyfnlitsnmg2rldfc7d8rbjt7kbkudin7rp2awrjhh-8=w1340-h587-rw

i'm making app (in android studio) , weird errors occurring, such large space left before image , text appearing on top of image. have researched no solutions helped.

content.xml:

<scrollview xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/scrollview01"     android:layout_width="fill_parent"     android:layout_height="fill_parent"> <relativelayout 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:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     android:paddingbottom="@dimen/activity_vertical_margin"     tools:context=".mainactivity$placeholderfragment">      <imageview         android:id="@+id/logo"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/logo"         android:layout_centerinparent="true"         android:layout_centerhorizontal="true"/>      <textview android:id="@+id/section_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_below="@+id/logo"         android:text="welcome!"         android:textsize="35dp"         android:layout_centerinparent="true"         android:textcolor="#fff"         android:gravity="center_horizontal"/>   </relativelayout> </scrollview> 

ps< have problem navigation drawer template in android studio, when clicking example action button transparent circle appears squared off on 1 side. :)

i suggest adding components linearlayout , centering within parent relativelayout.

example:

<scrollview     android:id="@+id/scrollview01"     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent">      <relativelayout 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:paddingbottom="@dimen/activity_vertical_margin"                     android:paddingleft="@dimen/activity_horizontal_margin"                     android:paddingright="@dimen/activity_horizontal_margin"                     android:paddingtop="@dimen/activity_vertical_margin"                     tools:context=".mainactivity$placeholderfragment">          <linearlayout             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_centerinparent="true"             android:gravity="center_horizontal"             android:orientation="vertical">              <imageview                 android:id="@+id/logo"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:src="@drawable/logo"/>              <textview                 android:id="@+id/section_label"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:text="welcome!"                 android:textcolor="#fff"                 android:textsize="35dp"/>         </linearlayout>     </relativelayout> </scrollview> 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -