Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHDropDownTextField/CHDropDownTextField.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
*/
@property (nonatomic, assign) BOOL canPaste;

/**
Indicates the textfields text inset by Y. Defaults to 0.
*/
@property (nonatomic, assign) CGFloat dY;

/**
Indicates the textfields text inset by X. Defaults to 0.
*/
@property (nonatomic, assign) CGFloat dX;

/**
Indicates the drop-down's number of visible rows at a time. Defaults to 0.
*/
Expand Down
10 changes: 10 additions & 0 deletions CHDropDownTextField/CHDropDownTextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ - (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
return [super canPerformAction:action withSender:sender];
}

// placeholder position
- (CGRect)textRectForBounds:(CGRect)bounds {
return CGRectInset(bounds, _dX, _dY);
}

// text position
- (CGRect)editingRectForBounds:(CGRect)bounds {
return CGRectInset(bounds, _dX, _dY);
}

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
Expand Down