|
@@ -126,15 +126,25 @@
|
|
|
-(void)hideDropDown:(UIButton *)b {
|
|
-(void)hideDropDown:(UIButton *)b {
|
|
|
CGRect btn = b.frame;
|
|
CGRect btn = b.frame;
|
|
|
|
|
|
|
|
- [UIView beginAnimations:nil context:nil];
|
|
|
|
|
- [UIView setAnimationDuration:0.3];
|
|
|
|
|
- if ([animationDirection isEqualToString:@"up"]) {
|
|
|
|
|
- self.frame = CGRectMake(btn.origin.x, btn.origin.y, btn.size.width, 0);
|
|
|
|
|
- }else if ([animationDirection isEqualToString:@"down"]) {
|
|
|
|
|
- self.frame = CGRectMake(btn.origin.x, btn.origin.y+btn.size.height, btn.size.width, 0);
|
|
|
|
|
- }
|
|
|
|
|
- table.frame = CGRectMake(0, 0, btn.size.width, 0);
|
|
|
|
|
- [UIView commitAnimations];
|
|
|
|
|
|
|
+// [UIView beginAnimations:nil context:nil];
|
|
|
|
|
+// [UIView setAnimationDuration:0.3];
|
|
|
|
|
+//
|
|
|
|
|
+// [UIView commitAnimations];
|
|
|
|
|
+
|
|
|
|
|
+ [UIView animateWithDuration:0.3 animations:^{
|
|
|
|
|
+
|
|
|
|
|
+ if ([self->animationDirection isEqualToString:@"up"]) {
|
|
|
|
|
+ self.frame = CGRectMake(btn.origin.x, btn.origin.y, btn.size.width, 0);
|
|
|
|
|
+ }else if ([self->animationDirection isEqualToString:@"down"]) {
|
|
|
|
|
+ self.frame = CGRectMake(btn.origin.x, btn.origin.y+btn.size.height, btn.size.width, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ self.table.frame = CGRectMake(0, 0, btn.size.width, 0);
|
|
|
|
|
+
|
|
|
|
|
+ } completion:^(BOOL finished) {
|
|
|
|
|
+
|
|
|
|
|
+ [self removeFromSuperview];
|
|
|
|
|
+
|
|
|
|
|
+ }];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
@@ -269,4 +279,22 @@
|
|
|
// [self release];
|
|
// [self release];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#pragma mark - Touch
|
|
|
|
|
+
|
|
|
|
|
+- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
|
|
|
|
|
+ BOOL inside = [super pointInside:point withEvent:event];
|
|
|
|
|
+
|
|
|
|
|
+ CGPoint btnPoint = [self convertPoint:point toView:btnSender];
|
|
|
|
|
+ BOOL btnInside = [btnSender pointInside:btnPoint withEvent:event];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (!inside && !btnInside) {
|
|
|
|
|
+ if (self.dropDownTouchOutsideBlk) {
|
|
|
|
|
+ self.dropDownTouchOutsideBlk();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return inside;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
@end
|
|
@end
|