uiview

Flip and zoom 3D transition problems (iOS 7+)

泪湿孤枕 提交于 2020-01-06 09:02:57
问题 I'm trying to build transition for card flip & zoom. I've made its model in Origami - Movie (less that 1Mb) As you can see there are 3 transforms applied at the same time: 1. moving center of the view to the centre of the screen 2. scaling 3. 3D rotte We can divide animation on equal 2 phases: Phase 1: Button scales, moves and rotates on the side (PI/2 radians). At the end of Phase 1 button disappears. Phase 2: toView (my modal view) rotates (from -PI/2 to 0 radians), scales up to the normal

how to check if the class is created by user of it is a class provided in pobjective-c API

久未见 提交于 2020-01-06 08:11:28
问题 i have a user-defined class of type CircularDynamicUIView. it is in an array the encompass several views like 'buttonviews, uiimageviews,scrollviews and others. how to programmatically within a loop to detect this user-defined class. for example: using if-statement how to check if this class is the class created or developed by the user and not the one that already created by objective-c. 回答1: As @rmaddy noted in comments, you cannot explicitly differentiate between, for example, your custom

IOS - How to force the view to landscape

♀尐吖头ヾ 提交于 2020-01-06 07:47:45
问题 I want to force my view to go for landscape, just when I call a method. When my method runs I call: [self shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)UIInterfaceOrientationLandscapeRight]; Method to autorotate - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return UIInterfaceOrientationIsLandscape(toInterfaceOrientation); } The problem is that the view don't force the rotation. Is possible to test it on the simulator, or just

UIScrollView doesn't scroll in the right direction

一世执手 提交于 2020-01-06 07:43:27
问题 I got a weird bug. I have a UIViewController with a UIScrollView embedded inside the UIView. Inside the UIScrollview are few images, but I need more space, so I want to put some images under the current ones. I did all the usual stuff to create and initialize my ScrollView, but instead of scrolling in the UP/DOWN direction, it scrolls LEFT/RIGHT … What is going on? I declared "UIScrollViewDelegate" in the .h My property @property (weak, nonatomic) IBOutlet UIScrollView *scrollViewContent; is

Sending datasource information only when UIView has been laid out?

大城市里の小女人 提交于 2020-01-06 06:34:16
问题 I am having trouble understanding this. I have been able to do such a project earlier on but now a similar approach isn't working for me. Here is the issue: I have a UIPageViewController that has 4 storyViewControllers . Each storyViewControllers has a custom containerView . I want to add 'n' number of UIViews on the containerView . I am sending the dataSource or 'n' from the view controller. However, I am not able to correctly lay out the subviews on the container view. Essentially I want to

Custom UIToolbar resize with animation

。_饼干妹妹 提交于 2020-01-06 05:40:19
问题 i'm using this piece of code to resize my custom UIToolbar to change width property [UIView animateWithDuration:0.3 delay:0.3 options:0 animations:^{ self.navToolbar.frame=CGRectMake(0, 0, 200, 30); } completion:nil]; the code above, change width correctly but without animation, could anyone tell me why? Thanks 回答1: UIViewAnimationOptionLayoutSubviews (iOS > 4.0) should fix the problem when the size change is not being animated. [UIView animateWithDuration:0.3 delay:0.3 options

Move a pixel through screen with swift

ε祈祈猫儿з 提交于 2020-01-06 03:45:09
问题 I'm interested in having a VC with objects and others (static, not necessarily dynamic) and apart from that, I want to have a pixel (one or four, depending if it can be seen for the human eye) moving around the borders of the screen (so in the bounds). I attach a photo of what I need: So I need that the "pixel" move indefinetely doing a square and I also need to know where it is to do something in my code (in swift) 回答1: You can use a solution something to Swift 2 UIView

Subclassed UIView shows black background if drawRect: is overridden

家住魔仙堡 提交于 2020-01-06 02:51:12
问题 I have a custom class which I derived from the UIView class. What I want to accomplish is just drawing vertical black lines with a predefined distance between. When I override the drawRect method and write my code to draw vertical lines, the view just shows a complete black background. Then I noticed that even an empty overridden drawRect which only calls the superclass' drawRect results in a black background. When I comment out the drawRect, then the view shows through and becomes

scaling UIScrollView contentSize to fit UIView with variable-height UITableView inside

一曲冷凌霜 提交于 2020-01-06 01:48:07
问题 I have a uiview with a uiscrollview as a subview in a nib. Then, I load another uiview with a uitableview as a subview of this other uiview (among other elements inside this view) as a subview of the uiscrollview. That is, UISCrollView -> UIView -> UITableView (and some other views inside the UIView). And I need to do the following: Once I know the final height of the tableview (depending on the number of cells and height of them) I need to resize the uiview containing it and, in turn, resize

scaling UIScrollView contentSize to fit UIView with variable-height UITableView inside

允我心安 提交于 2020-01-06 01:48:07
问题 I have a uiview with a uiscrollview as a subview in a nib. Then, I load another uiview with a uitableview as a subview of this other uiview (among other elements inside this view) as a subview of the uiscrollview. That is, UISCrollView -> UIView -> UITableView (and some other views inside the UIView). And I need to do the following: Once I know the final height of the tableview (depending on the number of cells and height of them) I need to resize the uiview containing it and, in turn, resize