UrbanApps / UAModalPanel

An animated modal panel alternative for iOS
http://code.coneybeare.net/uamodalpanel-an-open-source-modal-panel-alter
Other
877 stars 136 forks source link

closeButton appears under contentView in certain circumstances #24

Closed kennethmac2000 closed 12 years ago

kennethmac2000 commented 12 years ago

The closeButton: and actionButton: methods of UAModalPanel both use insertSubview:aboveSubview: to add their respective views to self.contentContainer. The contentView: method on the other hand uses the more basic addSubview: method.

From what I can see, two improvements would make sense here:

1) The insertSubview:aboveSubview: calls in closeButton: and actionButton: should say "aboveSubview:self.contentView" instead of "aboveSubview:self.roundedRectangle", since contentView must be above roundedRectangle for everything to look correct, and, currently (ie, without this change), in situations where the UAModalPanel instance's top and left padding values are small, contentView obscures closeButton due to closeButton being below contentView in the view hierarchy.

2) As an additional enhancement, in the contentView: method, the addSubview: call should be replaced with the following call:

[self.contentContainer insertSubview:contentView aboveSubview:self.roundedRect];

This makes it more clear what is going on and doesn't require one to think about the implicit ordering behaviour that is made use of when calling addSubview:.

coneybeare commented 12 years ago

Agreed for both issues. Please feel free to submit a pull request for these (sans inline comments) and I will merge it.

kennethmac2000 commented 12 years ago

Hi,

Just to clarify - do you mean both issues contained within issue #24 (ie, points (1) and (2) above)? Or was this also a reference to issue #23?

coneybeare commented 12 years ago

This is a reference to #24 only I havent had any time to dig into #23.