Caleb Madrigal

Programming, Hacking, Math, and Art


Eye movement on web pages

  • I've always preferred bulleted lists (and the like) over flat paragraph formats
  • I believe they can be visually parsed much faster than paragraphs
  • Now I have evidence: F-shaped reading pattern study :)

Here is an image which shows the eye movement of users on web pages (where red means more time was spent looking there): F Reading Pattern

How to place custom image in UITextField in iOS

Here is how to put an image in the right portion of a UITextField:

UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(55, 10, 660, 30)];
textField.rightViewMode = UITextFieldViewModeWhileEditing;

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 15, 15)];
imageView.image = [UIImage imageNamed:@"invalidFieldCircle"];
textField.rightView = imageView;

This also assumes that an image called "invalidFieldCircle.png" is in your project's "Resources" directory, which should be located just below the main project directory (you may have to create it).