UIButton with both image and text possible?

You can use this code,it will serve your purpose .h file code IBOutlet UIButton *testBtn; .m file code [testBtn setImage: [UIImage imageNamed:@”Image name.png”] forState:UIControlStateNormal]; [testBtn setTitleEdgeInsets:UIEdgeInsetsMake(70.0, -150.0, 5.0, 5.0)]; [testBtn setTitle:@”Your text” forState:UIControlStateNormal]; Adjust the coordinates and size of your button as your requirement.This is a sample code to guide you. PS:Take a UIButton in … Read more

How to add padding-left on a UIButton created programmatically?

titleEdgeInsets The inset or outset margins for the edges of the button title drawing rectangle. @property(nonatomic) UIEdgeInsets titleEdgeInsets Discussion Use this property to resize and reposition the effective drawing rectangle for the button title. You can specify a different value for each of the four insets (top, left, bottom, right). A positive value shrinks, or … Read more

How can you rotate text for UIButton and UILabel in Swift?

I am putting my answer in a similar format to this answer. Here is the original label: Rotate 90 degrees clockwise: yourLabelName.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2) Rotate 180 degrees: yourLabelName.transform = CGAffineTransform(rotationAngle: CGFloat.pi) Rotate 90 degrees counterclockwise: yourLabelName.transform = CGAffineTransform(rotationAngle: -CGFloat.pi / 2) Do the same thing to rotate a button. Thankfully the touch … Read more

UIButton bottom shadow

You can mix the cornerRadius and shadow properties. I tested it on iOS 8. Objective-C: [self.globeButton setImage:[UIImage imageNamed:@”Globe”] forState:UIControlStateNormal]; self.globeButton.backgroundColor = [UIColor colorWithRed:171 green:178 blue:186 alpha:1.0f]; // Shadow and Radius self.globeButton.layer.shadowColor = [[UIColor colorWithRed:0 green:0 blue:0 alpha:0.25f] CGColor]; self.globeButton.layer.shadowOffset = CGSizeMake(0, 2.0f); self.globeButton.layer.shadowOpacity = 1.0f; self.globeButton.layer.shadowRadius = 0.0f; self.globeButton.layer.masksToBounds = NO; self.globeButton.layer.cornerRadius = 4.0f; Swift: … Read more

UIBarButtonItem with custom view not properly aligned on iOS 7 when used as left or right navigation bar items

Works until iOS11! You can use negative flexible spaces and rightBarButtonItems property instead of rightBarButtonItem: UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; spacer.width = -10; // for example shift right bar button to the right self.navigationItem.rightBarButtonItems = @[spacer, yourBarButton];

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)