uiview

Cant interact with custom infowindow in google map

≡放荡痞女 提交于 2020-01-14 03:29:10
问题 I have a google map and I've created a custom info window for my markers. I've put a couple buttons on the window, but I can't interact with them for the life of me. Here is my custom view: class MarkerWindowView: UIView, UIGestureRecognizerDelegate { //@IBOutlet weak var thumbNail: UIImageView! @IBOutlet weak var userName: UILabel! @IBOutlet weak var videoLocation: UILabel! @IBOutlet weak var tags: UILabel! override func awakeFromNib() { println("awake From Nib") self.userInteractionEnabled

Empty space of 1 pixel above UINavigationBar

谁说胖子不能爱 提交于 2020-01-14 03:23:07
问题 In the landscape orientation I can "see through" one pixel of the view behind (the split view controller, visible between the status bar and the navigation bar): I rechecked the width, the height and the autoresize parameters of the top-most view with the navigation bar, however I cannot understand where does the gap come from. 来源: https://stackoverflow.com/questions/7818982/empty-space-of-1-pixel-above-uinavigationbar

Keep UIView inside Circle Objective-C

瘦欲@ 提交于 2020-01-13 17:23:23
问题 How can I have my Color Selector ( UIView ) to stay inside a color wheel that's 300px 300px? Im using the UIPanGestureRecognizer to drag the Color Selector around the color wheel UIImageView . The diameter of the color wheel is 300px. Here is the image of my UIViewController : The problem is that it can be dragged anywhere outside the wheel: So how can I keep my UIView that hovers over the color wheel say inside the circle? Your help is appreciated. 回答1: This really seems like more of a math

Why is hitTest not being called when views subview is touched?

痞子三分冷 提交于 2020-01-13 14:13:53
问题 I have a view which I'll call parentView which has a subview called childView . Part of childView is outside the bounds of parentView , and childView has a panGestureRecognizer attached to it. I have implemented the following in parentView so that it will recognize touches to childView even though it's outside of its superviews bounds: - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if (!self.clipsToBounds && !self.hidden && self.alpha > 0) { for (UIView *subview in self

How to animate a UIView going off the screen to the right, and then reappearing back from the left

有些话、适合烂在心里 提交于 2020-01-13 13:06:56
问题 I have a view that is contained in the main view of my application (a square in the middle of a screen). I've written the following code that slides the view off the screen to the right, if you swipe it to the left: - (IBAction)swipeLeft:(id)sender { CGRect initCardViewFrame = self.cardView.frame; CGRect movedCardToRightViewFrame = CGRectMake(initCardViewFrame.origin.x + 1000, initCardViewFrame.origin.y, initCardViewFrame.size.width, initCardViewFrame.size.height); [UIView animateWithDuration

How to animate a UIView going off the screen to the right, and then reappearing back from the left

旧时模样 提交于 2020-01-13 13:06:15
问题 I have a view that is contained in the main view of my application (a square in the middle of a screen). I've written the following code that slides the view off the screen to the right, if you swipe it to the left: - (IBAction)swipeLeft:(id)sender { CGRect initCardViewFrame = self.cardView.frame; CGRect movedCardToRightViewFrame = CGRectMake(initCardViewFrame.origin.x + 1000, initCardViewFrame.origin.y, initCardViewFrame.size.width, initCardViewFrame.size.height); [UIView animateWithDuration

Keyframe animation key time

99封情书 提交于 2020-01-13 09:04:10
问题 I've just created a keyframe animation like this: [UIView animateKeyframesWithDuration:10 delay:0 options:0 animations:^{ [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:.1 animations:^{ view.alpha = 0; }]; } completion:nil]; And this is a CAKeyframeAnimation that gets created: (lldb) po [self.layer animationForKey:@"opacity"] <CAKeyframeAnimation:0x10a6364b0; keyTimes = ( 0, "0.1", 1 ); values = ( 1, 0, 0 ); calculationMode = linear; delegate = <UIViewKeyframeAnimationState:

Using auto-layout in a custom view where constraints rely on frame

青春壹個敷衍的年華 提交于 2020-01-13 09:01:56
问题 I'm writing a custom view that is initialized programmatically. I override updateConstraints to add all the constraints required for this view. : - (void)updateConstraints { [self.superview addConstraint:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]]; [self.superview addConstraint:[NSLayoutConstraint constraintWithItem:self attribute

Why isn't my UIButton responding to touches?

丶灬走出姿态 提交于 2020-01-13 04:49:29
问题 I'm sure I'm overlooking the obvious as I've got countless working buttons...but...for whatever reason this one is not cooperating... I've added a UIButton (Rounded Rect) to a UIView subclass (DialogView) which is a subview of my view controller's view. This subview is created almost entirely in IB. I've wired up the button to (IBAction)okButtonPressed:(id)sender in IB to Touch Up Inside and created a corresponding method in DialogView. However when I "touch" this button it doesn't trigger

Why isn't my UIButton responding to touches?

为君一笑 提交于 2020-01-13 04:48:13
问题 I'm sure I'm overlooking the obvious as I've got countless working buttons...but...for whatever reason this one is not cooperating... I've added a UIButton (Rounded Rect) to a UIView subclass (DialogView) which is a subview of my view controller's view. This subview is created almost entirely in IB. I've wired up the button to (IBAction)okButtonPressed:(id)sender in IB to Touch Up Inside and created a corresponding method in DialogView. However when I "touch" this button it doesn't trigger