Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)showIndexPath:(NSIndexPath*)indexPath inView:(UIView*)view{
- UILabel *lbl = [[UILabel alloc] init];
- lbl.text = [NSString stringWithFormat:@"%ld-%ld", (NSUInteger)indexPath.section, (NSUInteger)indexPath.item];
- lbl.font = [UIFont systemFontOfSize:8.f];
- lbl.numberOfLines = 0;
- lbl.backgroundColor = [UIColor blackColor];
- lbl.textColor = [UIColor whiteColor];
- [lbl sizeToFit];
- [view addSubview:lbl];
- NSMutableArray *constraints = [NSMutableArray array];
- [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[lbl(10)]" options:NSLayoutFormatAlignAllLeft metrics:nil views:@{@"lbl":lbl}]];
- [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[lbl(10)]-|" options:NSLayoutFormatAlignAllLeft metrics:nil views:@{@"lbl":lbl}]];
- [NSLayoutConstraint activateConstraints:constraints];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement