"Android Interview Treasure" study notes (Chapter III: Components)

Source: Internet
Author: User

Which ways does Android support display Rich text information?

1, using Rich text tags, similar to HTML tags, such as <b>,<font>,, but not directly as Textview.settext parameter values, but should be static html.fromhtml development method Convert the text to a Charsequence object. If you want to display the picture, you also need to implement the Imagegetter interface

2, rewrite the OnDraw development method

3, using Webview components Display HTML page

Display pictures in 4,textview You can also use the Imagespan object, which encapsulates the bitmap object and encapsulates the Imagespan object through the Spannablestring object as a parameter to the SetText development method.


How do I implement hyperlinks in TextView?

Instantiate a Clickablespan object and implement the OnClick method.


How do I set a background color for text?

Use Backgroundcolorspan.


The use of selector?

Http://blog.csdn.net/shakespeare001/article/details/7788400/


How do I adjust the transparency of an image?

First use bitmap to load the image, Paint.setalpha set the transparency, and then use the OnDraw method, the bitmap and Paint as parameters to pass in.


How do I set the progress bar color?

http://blog.csdn.net/catoop/article/details/39667841


How do I implement a vertical progress bar?

Draw it yourself.


What are the abstract methods of the Baseadapter class?

GetItem, Getitemid, GetCount, getView (int position, View Convertview, ViewGroup parent)


How do I set a quick slider for a ListView?

Listview. Setfastscrollenabled (True)


What subclasses are there in ViewGroup?

Layout, GridView, Gallery, ListView


How can I make the components inside the container slide horizontally and vertically?

Use ScrollView, and nest Horizontalscrollview in it.








"Android Interview Treasure" study notes (Chapter III: Components)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.