Pages

Saturday, September 15, 2012

Attributes, Methods and Events for TextView, EditText and Button



TextView: Displays text to the user and optionally allows them to edit it.

EditText: EditText is a thin veneer over TextView that configures itself to be editable.

Button: Represents a push-button widget. Push-buttons can be pressed, or clicked, by the user to perform an action. 


XML Attributes & related Methods

Attribute Name Related Method Description
android:ems setEms(int) Makes the TextView be exactly this many ems wide. An em is a unit of measurement in the field of typography, equal to the currently specified point size.
android:gravity setGravity(int) Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view. 
android:height setHeight(int) Makes the TextView be exactly this many pixels tall. 
android:hint setHint(int) Hint text to display when the text is empty. 
android:lines setLines(int) Makes the TextView be exactly this many lines tall. 
android:password setTransformationMethod(TransformationMethod) Whether the characters of the field are displayed as password dots instead of themselves. 
android:text setText(CharSequence) Text to display. 
android:textSize setTextSize(int, float) Size of the text. 
android:textStyle setTypeface(Typeface) Style (bold, italic, bolditalic) for the text. 
android:width setWidth(int) Makes the TextView be exactly this many pixels wide. 

 

Note: attributes and methods are common for TextView, Edit Text and Button

Events

Void OnTextChanged (CharSequence text, int start, int lengthBefore, int lengthAfter)
This method is called when the text is changed, in case any subclasses would like to know.


Boolean onGenericMotionEvent(MotionEvent event) 
Implement this method to handle generic motion event
 
setOnClickListerner(OnClickListener) 
Event occurs after clicking on button.

48 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. EditText is an overlay over TextView that configures itself to be editable. It is the predefined subclass of TextView that includes rich editing capabilities.
    Android Training in chennai | Android Training|Android Training in chennai with placement | Android Training in velachery

    ReplyDelete
  3. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.


    Data Science Training in Chennai
    Data science training in bangalore
    Data science online training
    Data science training in pune
    Data Science training in kalyan nagar
    Data Science training in OMR
    selenium training in chennai

    ReplyDelete
  4. Nice tips. Very innovative... Your post shows all your effort and great experience towards your work Your Information is Great if mastered very well.
    python training in annanagar
    python training in chennai
    python training in chennai
    python training in Bangalore

    ReplyDelete
  5. Well somehow I got to read lots of articles on your blog. It’s amazing how interesting it is for me to visit you very often.
    Blueprism online training

    Blue Prism Training in Pune

    ReplyDelete
  6. The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in btm

    ReplyDelete
  7. The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.
    devops online training

    aws online training

    data science with python online training

    data science online training

    rpa online training

    ReplyDelete
  8. Hello, I read your blog occasionally, and I own a similar one, and I was just wondering if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can advise? I get so much lately it’s driving me insane, so any assistance is very much appreciated.
    Android Training in Chennai | Best Android Training in Chennai
    Matlab Training in Chennai | Best Matlab Training in Chennai
    Best AWS Training in Chennai | AWS Training in Chennai
    Selenium Training in Chennai | Best Selenium Training in chennai
    Devops Course Training in Chennai | Best Devops Training in Chennai

    ReplyDelete
  9. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    blue prism Training in Electronic City

    ReplyDelete
  10. Thanks for sharing the knowledge. So useful and practical for me. I learned something new. Very well written. It was so good to read and useful to improve knowledge. If you are looking for any Big Data related information, check our Bigdata training in bangalore web page. Thanks a lot.

    ReplyDelete
  11. medical care is what many people lack in the interior areas of the world. people face a lot of health issues everyday without solution. buy psychedelics online, Buy weed online, Buy alprazolam online

    ReplyDelete

  12. lovely site get you purest research chemicals online and pills at cheap and in a 48 hours delivery time maximum
    buy pills online
    buy fentanyl powder online
    buy scopolamine powder online

    ReplyDelete
  13. This is a very knowledge and informative blog..
    Thanks for sharing with us,
    We are again come on your website,
    Thanks and good day,
    Please visit our site,
    buylogo

    ReplyDelete
  14. I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more.

    data science course

    ReplyDelete
  15. Thank you for sharing such a nice and interesting blog with us regarding Java. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle.
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  16. Nice tips. Very innovative... Your post shows all your effort and great experience towards your work Your Information is Great if mastered very well.
    AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  17. Attend The Data Science Courses From ExcelR. Practical Data Science Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Courses. data science courses

    ReplyDelete
  18. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.Best data science courses in hyerabad

    ReplyDelete
  19. Nice content very helpful, It has a very important point which should be noted down. All points mentioned and very well written.Keep Posting & writing such content

    AWS Online Training
    Online AWS Certification Training

    ReplyDelete
  20. magnificentincense.com
    24K Monkey Classic Incense 10g
    AK-47 – X10 / PREMIUM
    Bizarro Incense
    Buy Black Mamba Incense Online
    Buy WTF Herbal Incense
    Cloud9 Mad Hatter Incense
    Crazy Monkey Incense
    k2 spray on paper
    k2 paper sheets
    Klimax Potpourri 15xxx Coconut(10g)
    Crazy Monkey Incense
    Cloud9 Mad Hatter Incense
    Buy Purple Diesel Incense Online
    Buy Pure Fire Herbal Incense Online
    Buy Kisha Cole Incense (11g) online
    Buy KUSH HERBAL INCENSE online
    Buy Mind Trip Incense Online
    Buy Platinum XXX Herbal Incense online
    buy Orange Platinum Caution 10G
    Buy OMG HERBAL POTPOURRI 10G online

    ReplyDelete
  21. https://k2incenseonlineheadshop.com/
    info@k2incenseonlineheadshop.com
    Buy liquid incense cheap
    Buy liquid incense cheap For Sale At The Best Incense Online Shop
    K2 Spice Spray | Liquid K2 | Liquid Spice | K2 Spray for sale

    ReplyDelete
  22. https://syntheticworldwide.com/
    sales@syntheticworldwide.com

    Buy cheap liquid herbal incense at your best online shop

    ReplyDelete
  23. Outstanding blog appreciating your endless efforts in coming up with an extraordinary content. Which perhaps motivates the readers to feel excited in grasping the subject easily. This obviously makes every readers to thank the blogger and hope the similar creative content in future too.

    Data Analytics Course in bhilai

    ReplyDelete
  24. Astounding Blog! I might want to thank for the endeavors you have made recorded as a hard copy this post. I am trusting a similar best work from you later on too. I needed to thank you for this sites! Much obliged for sharing. Extraordinary sites!
    data scientist course in hyderabad

    ReplyDelete
  25. This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
    buy crystal meth online

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Dia herbal Tea with 21+ Natural herbs benefits shop now with Vedics.shop

    ReplyDelete
  28. You have written an excellent blog. I learned something new from your Content. Keep sharing this kind of informative blog.
    Oracle DBA Responsibilities
    DBA Activities

    ReplyDelete
  29. Now-a-days cannabis medicine are legal in India. We can use cannabis medicines in various forms such as Cannabis oil, cannabis oil capsules etc.

    ReplyDelete
  30. A few studies suggest that Cannabis oil as well as other CBD products can help with symptoms of depression.

    ReplyDelete

  31. Cultivation of cannabis(cannabis in india) for industrial purposes such as making industrial hemp or for horticultural use is legal in India.

    ReplyDelete
  32. Great Blog really enjoyed reading it, I will share this to my friends and this will help them in many ways, if you are looking for Web application Development Company then toiuch and get benefited

    ReplyDelete
  33. Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.
    data scientist course in hyderabad

    ReplyDelete
  34. Really an awesome blog and informative content. Keep sharing more bogs with us. If you want to become a data science course training, the follow the given below link.
    Data Science Course with Placements in Hyderabad

    ReplyDelete
  35. This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post.
    data science training

    ReplyDelete
  36. 360DigiTMG offers the best Data Analytics courses in the market with placement assistance. Enroll today and fast forward your career.


    Data Analytics Course in Calicut

    ReplyDelete
  37. This comment has been removed by the author.

    ReplyDelete