android - How to place my text over the image in ScrollView -


i new android ,i had 4 textviews , 1 imageview,i want display image on 2 textview remaining textview display down image view should display scrollview [![i want scrollview]

http://i.stack.imgur.com/bexvl.png

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout  android:layout_width="match_parent" android:layout_height="0dp"  android:layout_weight="0.5">  <imageview android:id="@+id/image"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_alignparentbottom="true"  android:layout_centerhorizontal="@+id/textvats"     android:adjustviewbounds="true"     android:background="@drawable/image2"     android:src="@drawable/image2" /> <textview     android:id="@+id/textvat"     android:layout_width="275dp"     android:layout_height="45dp"     android:layout_alignparentleft="true"     android:layout_alignparentright="true"     android:layout_centervertical="true"     android:gravity="center_horizontal"     android:text="pavan"     android:textcolor="#ffffff"     android:textsize="25dp"     android:textstyle="bold"      /> </relativelayout > <textview android:id="@+id/text" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="pawan" android:textsize="20dp" android:textstyle="bold"/> <textviewandroid:id="@+id/textv" style="@style/codefont" android:layout_weight="0.45" android:text="@string/hello" /> <button android:layout_width="fill_parent"  android:layout_height="wrap_content"  android:background="#ff00f0"/> </linearlayout> 

try piece of code ..it has textviews on imageview clear doubt

<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:background="@drawable/background" android:orientation="vertical" android:padding="10dip">   <progressbar     android:id="@+id/loginprogressbar"     style="?android:attr/progressbarstylelarge"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_below="@+id/imageview4"     android:layout_centerhorizontal="true"     android:visibility="invisible" />  <edittext     android:id="@+id/emailedittext"     android:layout_width="200dp"     android:layout_height="35dp"     android:layout_above="@+id/postedontextview"     android:layout_alignend="@+id/passwordedittext"     android:layout_alignleft="@+id/registerclicktext"     android:layout_alignright="@+id/passwordedittext"     android:layout_alignstart="@+id/registerclicktext"     android:layout_marginbottom="10dp"     android:autotext="false"     android:inputtype="textemailaddress" />  <edittext     android:id="@+id/passwordedittext"     android:layout_width="200dp"     android:layout_height="35dp"     android:layout_above="@+id/loginbutton"     android:layout_alignend="@+id/forgotclicktext"     android:layout_alignleft="@+id/registerclicktext"     android:layout_alignright="@+id/forgotclicktext"     android:layout_alignstart="@+id/registerclicktext"     android:layout_marginbottom="15dp"     android:inputtype="textwebpassword|textpassword" />  <button     android:id="@+id/loginbutton"     android:layout_width="150dp"     android:layout_height="35dp"     android:layout_above="@+id/registerclicktext"     android:layout_centerhorizontal="true"     android:layout_marginbottom="29dp"     android:text="login" />  <imageview     android:id="@+id/imageview4"     android:layout_width="300dp"     android:layout_height="80dp"     android:layout_alignparentend="true"     android:layout_alignparentleft="true"     android:layout_alignparentright="true"     android:layout_alignparentstart="true"     android:layout_margintop="29dp"     android:src="@drawable/logoapp" />  <textview     android:id="@+id/textview"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_above="@+id/emailedittext"     android:layout_alignleft="@+id/emailedittext"     android:layout_alignstart="@+id/emailedittext"     android:text="email"     android:textcolor="#000000" />  <textview     android:id="@+id/postedontextview"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_above="@+id/passwordedittext"     android:layout_alignleft="@+id/passwordedittext"     android:layout_alignstart="@+id/passwordedittext"     android:text="password"     android:textcolor="#000000" />  <textview     android:id="@+id/registerclicktext"     android:layout_width="80dp"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_marginbottom="83dp"     android:layout_toleftof="@+id/loginprogressbar"     android:text="new user?"     android:textcolor="#c3807e7f" />  <textview     android:id="@+id/forgotclicktext"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignleft="@+id/loginprogressbar"     android:layout_alignstart="@+id/loginprogressbar"     android:layout_below="@+id/loginbutton"     android:layout_marginleft="47dp"     android:layout_marginstart="47dp"     android:text="forgot password"     android:textcolor="#c3807e7f" />  <progressbar     android:id="@+id/progressbar"     style="?android:attr/progressbarstylesmall"     android:layout_width="30dp"     android:layout_height="30dp"     android:layout_alignparentend="true"     android:layout_alignparentright="true"     android:layout_alignparenttop="true"     android:visibility="invisible" /> </relativelayout> 

use code in xml . hope you.

p.s. if need scroll ability add whole xml code inside scroll view tag

sample scroll view

<scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/dashboard" android:layout_width="match_parent" android:layout_height="wrap_content" android:fillviewport="true" android:scrollbars="none" tools:context=".mainactivity">  <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/school"      android:layout_width="match_parent"     android:layout_height="wrap_content"     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">  rest of xml components   </relativelayout> </scrollview> 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -