Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Hour 12. Adding Application Logic > Working with ViewSwitcher Controls - Pg. 203

Working with ViewSwitcher Controls 203 9. Within the new RelativeLayout control, add an ImageSwitcher control with an id of @+id/ImageSwitcher_QuestionImage . Set layout_width to wrap_content and layout_height to wrap_content . Also, set its layout_alignParentTop and layout_centerInParent attributes to true . 10. Below the ImageSwitcher control, add a TextSwitcher control with an id of @+id/TextSwitcher_QuestionText . Set layout_width to wrap_content and layout_height to wrap_content . Also, set its layout_centerInParent attrib- ute to true and its layout_below attribute to @+id/ImageSwitcher_QuestionImage . 11. Below the TextSwitcher control, add a Button control with an id of @+id/Button_Yes . Set layout_width to wrap_content and layout_height to wrap_content . Also, set its layout_alignParentBottom and layout_alignParentLeft attributes to true . Set its text attribute to a resource string ("Yes" ) and tweak any other attributes to make the Button control look nice. 12. Add another Button control below the previous Button control, with an id of @+id/Button_No . Set the layout_width to wrap_content and the