CEWendel / SWTableViewCell

An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application)
MIT License
7.13k stars 1.27k forks source link

How to change the height of button? #403

Closed ChungMai closed 8 years ago

ChungMai commented 8 years ago

I want to change the height of right button because my conten cell have large padding bottom. Please show me how to change it.

I can change the height of button by editing the constrain in *(void)setUtilityButtons:(NSArray )utilityButtons WithButtonWidth:(CGFloat)width** method as follows:

 [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[button]-bottom-|"
                                                                         options:0L
                                                                         metrics:@{@"bottom":@(8.0)}
                                                                           views:NSDictionaryOfVariableBindings(button)]];

Could you please modify your library to support the change of button height?

ChungMai commented 8 years ago

I have downloaded the source code and edited it as I need.

goel232 commented 7 years ago

@ChungMai Hello friend can you help me with how to change the width and height of button ?? at which file I must see it ?

ChungMai commented 7 years ago

Hi @goel232 . If you want to change the width of button, the library is supported to change it through function (void)setUtilityButtons:(NSArray *)utilityButtons WithButtonWidth:(CGFloat)width

If you want to change the height of button, you must download source code of sample project (the library is not supported a public method to configure the heigh button), then you will find the PodFiles folder on SWTableViewCell parent folder. PodFile is where contain all code for the customised view. In SWTableViewCell file at (void)setUtilityButtons:(NSArray *)utilityButtons WithButtonWidth:(CGFloat)width (same method to change the width) where you can add the code to change the heigh to how you want. Example: you add the following code to change the bottom and top margin of the button - the height is changed as well [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-top-[button]-bottom-|" options:0L metrics:@{@"bottom":@(8.0), @"top":@(8.0)} views:NSDictionaryOfVariableBindings(button)]];