PowenKo, Android Tutorial 012-7,EditText display hint string

November 15, 2011   ·   0 Comments

EditText display hint string

We can set edittext hint by using edittext ‘android:hint’ property.

Edittext hint is used to display a hint about the edittext.

Example: – When we are creating a login window we will create a textview & editext.

Textview is for input (“Enter the username”).

Editext is for output (“androidpeople”).

By using edittext hint we need not create a textview for input. We can provide input text in edittext hint.


    <EditText
   android:id="@+id/autoCompleteTextView1"
   android:layout_height="31dip"
   android:layout_width="fill_parent"
   android:background="@drawable/search_edit_bg"
   android:hint="search keyword"
   android:singleLine="true"
   android:lines="1"
   android:maxLines="1">
    </EditText>

in code

EditText.setHint("search keyword");
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon