Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.55 KB

README.md

File metadata and controls

47 lines (30 loc) · 1.55 KB

THComboBox

An IBDesignable custom combobox control for iOS. The text font can resize adaptively.

Installation

pod 'THComboBox'

Attention:IBDesignable doesn't work with static libraries in Xcode now. Probably you'll meet this problem. Maybe this bug will be fixed in the future. But now you'd better install it from source.

From source

  • Drag the THComboBox/ folder to your project
  • #import "THComboBox.h"

How To Use

With Storyboards or Xib

Create a UIView and change its class to THComboBox

Open the Attribute Inspector, and customize the properties:

Give the listItems and set the delegate:

self.comboBox1.listItems = @[@"主楼",@"学堂",@"文图",@"东门"];
self.delegate = self;		//let the viewcontroller implement ComboBoxDelegate

Create programmatically

Very easy like this:

THComboBox *comboBox2 = [[THComboBox alloc] initWithFrame:CGRectMake(200, 400, 210, 60)];
self.comboBox2.listItems = @[@"ob-c",@"java",@"c#",@"c++"];
self.delegate = self;		//let the viewcontroller implement ComboBoxDelegate

Then change the settings programmatically.