A style is a collection of properties that specify the look and format for a View or window. A style can specify properties such as height, padding, font color, font size, background color, and much more. A style is defined in an XML resource that is separate from the XML that specifies the layout. To

Android provides the ListView  class which is capable of displaying a scrollable list of items. An adapter is used for managing the items in the list (the data model or data source). Every line in the list view consists of a layout which can be as complex as you want. The adapter would inflate the

Android provides the ListView  class which is capable of displaying a scrollable list of items. A ListView typically contain more data then the number of displayed rows. If the user scrolls the list then rows and their associated Views will be scrolled out of the visible area. The Java objects which represents the rows can

ScrollView is a layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex

ListView selector property

Thursday, 22 August 2013 by

Android provides the ListView  class which is capable of displaying a scrollable list of items.The items in the list can be of any type. An adapter is used for managing the items in the list. Individual list item can be selected.we can change from the default theme is the color of the pressed itemview. In

Tagged under: ,

In a Listview two different color can be set for odd row and even row.By creating a custom adapter  and by extending the ArrayAdapter and overriding  the getView method it can be handled. And inside the getView method based on the condition   the color of the text  can be changed using  setBackgroundcolor attribute. let see

ListView  shows items in a vertically scrolling list.Divider height and divider color of two consecutive row of a listview can be set both from xml or programmatically. Code for layout:  Declare these two line as xml attribute of ListView Code for res/drawable/divider_gradient.xml: From Activity the height and color can be set:  

ListView onItemClickListener

Wednesday, 14 August 2013 by

ListView shows items in a vertically scrolling list. The items come from the ListAdapter associated with this view.  When any item in this List has been clicked  onItemClickListener  method is invoked. Implementers can call getItemAtPosition(position) if they need to access the data associated with the selected item. Code:

Tagged under: ,

ListView cachecolor hint transparent

Wednesday, 14 August 2013 by

ListView has a transparent/translucent background by default, . This implies that when ListView redraws its children, it has to blend the children with the window’s background. To improve drawing performance during scrolling operations, the Android framework reuses the cache color hint. When this hint is set, the framework copies each child of the list in

Tagged under: ,

ListView is a view group that displays a list of scrollable items.The background of the ListView can be set with a color gradient both dynamically or defining in drawable xml file. Code for layout: Code for background_inner in res drawable folder: Code for set gradient color background dynamically: Code in Adapter class:  

TOP