Skip to content
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

Disable Title Shadow configuration added #25

Merged
merged 1 commit into from
Aug 17, 2014
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@
* The colour of the triangle in the top scroller. If not set, the default will be black. **/
@property (nonatomic, strong) UIColor *triangleBackgroundColour;

/** @property disableTitleShadow
* @brief Disables the shadow effect on the title label
* If set to YES the shadow effect on the title should be disabled. Default is NO. **/
@property (nonatomic) BOOL disableTitleShadow;

/** @property disableTopScrollerShadow
* @brief Disables the shadow effect on the top header scroller
* If set to YES the shadow effect on the top header scroller will be disabled. Default is NO. **/
Expand Down
17 changes: 10 additions & 7 deletions UIScrollViewSlidingPages/Source/TTScrollSlidingPagesController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self.titleScrollerHidden = NO;
self.titleScrollerHeight = 50;
self.titleScrollerItemWidth = 150;
self.disableTitleShadow = NO;

UIImage *backgroundImage = [UIImage imageNamed:@"diagmonds.png"];
if (backgroundImage != nil){
Expand Down Expand Up @@ -249,13 +250,15 @@ -(void)reloadPages{
label.textColor = self.titleScrollerInActiveTextColour;
label.font = self.titleScrollerTextFont;
label.backgroundColor = [UIColor clearColor];

//add subtle drop shadow
label.layer.shadowColor = [self.titleScrollerTextDropShadowColour CGColor];
label.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
label.layer.shadowRadius = 2.0f;
label.layer.shadowOpacity = 1.0f;


if (self.disableTitleShadow) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be?

if (!self.disableTitleShadow) {

Because you have set it to YES (disable it) for it to be added, which should be the other way around

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you're right! I overlooked that when checking it, fixed now - thanks! :-)

//add subtle drop shadow
label.layer.shadowColor = [self.titleScrollerTextDropShadowColour CGColor];
label.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
label.layer.shadowRadius = 2.0f;
label.layer.shadowOpacity = 1.0f;
}

//set view as the top item
topItem = (UIView *)label;
}
Expand Down