-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button padding #14
Comments
There is a better way to add padding than adding spaces to the button titles. After creating a MGSwipeButton you can change it's frame and for example add 10 points to its frame size. You can also toy with UIEdeContentInsets because MGSwipeButton is a UIButton subclass. In the last commit I have added an optional width parameter to MGSwipeButton static constructor to make this easier. |
Thanks for the info! Any way to automatically have MGSwipeTableCell handle this? I'm a little worried about scaling issues with different devices. Would rather have MGSwipeTableCell default with a little more padding. |
On second thought I have changed the width parameter to a padding. I agree that padding is better to handle scaling among many devices. The padding parameter is optional, the default value is 10 points. If you need more customizable paddings you can toy with contentEdgeInsets, titleEdgeInsets and imageEdgeInsets properties and call [button sizeToFit]. Let me know if it works for you now ;) |
Thanks! I'll check it out tonight. While you're looking at it, wanted to ask if you happen to size the buttons to the same width if the text differs? It seems like you were, which is a nice feature. |
Yes, buttons always have the same width (the size of the larger one) if the text differs. |
The buttons look good. One thing I did notice was the after swiping on my extended UITableViewCell all the hidden views on the cell suddenly became visible. I didn't see this in the release from last week. I'll try to create a new issue with a picture. On Saturday, September 27, 2014 1:24 PM, Imanol Fernandez notifications@github.com wrote: Closed #14. |
Hi robjkc, I have fixed the hidden views issue, try with the latest version. |
Tried it out today and it looks great. Only one last small issue. The default UITableView animation effect when a row is deleted is that the row collapses. For some reason the MGSwipeTableCell doesn't have the same animation effect. Is there a way you can duplicate this? On Sunday, September 28, 2014 7:21 AM, Imanol Fernandez notifications@github.com wrote: Hi robjkc, |
Hi. @MortimerGoro i have to make the cell like attached the image add some space before the Swipe Button. how can i achive like this. Thanks in advance, |
One more small issue, I created my swipe buttons like below, but noticed that there was very little space around the text when displayed on screen.
[MGSwipeButton buttonWithTitle:@"Trash" backgroundColor:[UIColor redColor]];
[MGSwipeButton buttonWithTitle:@"More" backgroundColor:[UIColor lightGrayColor]];
To get around this I added spaces to one of the titles like so which caused both the Trash and More button widths to expand:
[MGSwipeButton buttonWithTitle:@" Trash " backgroundColor:[UIColor redColor]];
Is there a way you could implement a default padding similar to how Apple and components like MSCMoreOptionTableView display so I can avoid doing this myself?
Looking forward to adding this to my app so I can add right swipe as well. Thanks!
The text was updated successfully, but these errors were encountered: