Homework 7


Downloads

SpeakersListDone

Aim

This homework will get you to understand custom table cells better.

Task

Modify the custom cell in SpeakersList to have an on/off switch control instead of the text field on the right (I'll leave it up to you to find out what class implements that control). The switch should be set to "on" for rows where the name of the language has an odd number of characters, and "off" for the rest.

The right edge of the switch control should be 20 pixels away from the right edge of the screen, and it should be vertically centered in the cell.

Hints

Documentation.

This assignment is mainly dealing with geometry. Note that there are two methods you will be interested in: frame and bounds. A view's frame is its dimensions as seen by its superview. A view's bounds is its dimensions as seen from inside itself. Most of the time (including in this assignment), the origin component of bounds is (0, 0), whereas the origin component of frame for the same view is not zero (it's wherever the view is positioned inside its superview). So you will be interested in the cell's bounds and the switch's frame.

Due

Wednesday March 25, at midnight (11:59PM Wednesday)

Submission

LabFusion (delete the build directory and zip the project directory)

Solution

Here

Back to the main page