Additional Functionality


In addition to supporting a number of built-in styles, iOS provides the ability to create a completely custom row. Although the specifics are beyond the scope of this article, the basic steps are as follows:

  • Create a new class that subclasses UITableViewCell.
  • Be sure to create an associated xib file.
  • Add custom widgets to the xib file.
  • Ensure that the xib file uses your new class as the 'custom class'.
  • Register the xib file with the table view
  • In the method cellForRowAtIndexPath:, ensure that dequeueReusableCellForIdentifier: references the new xib name


Each text view within an Android layout file includes the ability to attach an image (or drawable). This image can be placed on any side of the text view rectangle. Images are specified in the XML file as so:

  1. <TextView
  2. android:id="@+id/annotatedText"
  3. android:layout_width="wrap_content"
  4. android:layout_height="wrap_content"
  5. android:drawableTop="@drawable/topImage"
  6. android:drawableLeft="@drawable/leftImage"
  7. android:drawableRight="@drawable/rightImage"
  8. android:drawableBottom="@drawable/bottomImage"
  9. android:text=""
  10. android:textSize="20sp" >
  12. </TextView>

I didn't use this approach in my example, because I wanted the two vertical rows of text to both line up with the image. However, since it makes the XML files much cleaner, I use this technique whenever possible.