uiview-hierarchy

Detect if a UIView is behind another UIView in parent

柔情痞子 提交于 2019-12-24 04:14:04
问题 I have a parent UIView with several subviews. The subviews are siblings - the child-views are not sub views of each other. (Each at the same heirarchical level in their superview) For instance: UIView *containerView = [[UIView alloc] initWithFrame:frame]; CustomUIView *childView = [[UIView alloc] initWithFrame:anotherFrame]; CustomUIView *yetAnotherChildView = [[UIView alloc] initWithFrame:anotherFrame]; [containerView addSubview:childView]; [containerView addSubview:yetAnotherChildView];

What is _UILayoutGuide?

六月ゝ 毕业季﹏ 提交于 2019-12-18 13:06:34
问题 I need to know about _UILayoutGuide , like what it is, what it does and why it present in the hierarchy of UIView as a subview with almost always frame = (0,0,0,0) . 回答1: UILayoutGuide is normally referred to -topLayoutGuide and -bottomLayoutGuide, those are not really constraints, but they are view elements conform to a protocol called UILayoutSupport . You can find more info about that protocol here. The value is often 0 but you should pay a lot of attention where you ask their size. 回答2:

Determine whether UIView is covered by other views?

让人想犯罪 __ 提交于 2019-12-12 09:19:29
问题 I'm building a simple card game where cards are flicked onto a central pile, and I'd like to begin removing the bottom cards when the number gets too large. However, I apply some random rotation and positioning to each card, meaning the corners of some of them stick out, etc. Here's a screenshot: What I'd like to do is ascertain whether any portion of a view is visible to the user, and remove any that are completely covered by other views. The views are all instantiated, they are all inside

UIDesign advice for the application

佐手、 提交于 2019-12-11 18:19:59
问题 I have tried to draw the UI that I want to make for my application which is related to comparing the cricketers and giving their updates Now as you can see above In compare screen there are two sections One is image where two user can like and dislike and other thing is that you will get live updates of the above images which u have already liked or disliked.. This whole screen is scrollable and the compare sections height is set during runtime depending on the number of rows we get at the

Determine whether UIView is covered by other views?

℡╲_俬逩灬. 提交于 2019-12-04 20:08:45
I'm building a simple card game where cards are flicked onto a central pile, and I'd like to begin removing the bottom cards when the number gets too large. However, I apply some random rotation and positioning to each card, meaning the corners of some of them stick out, etc. Here's a screenshot: What I'd like to do is ascertain whether any portion of a view is visible to the user, and remove any that are completely covered by other views. The views are all instantiated, they are all inside the same superview, and they are all within the bounds of the view, so using these methods will not work

How to Insert View in Superview's View? (iOS)

孤者浪人 提交于 2019-12-02 05:53:29
问题 I have the line of code below... How would I modify it to insert the subview in the superview's view named 'foo'? [[self superview] addSubview:copy3]; 回答1: There are more than 1 ways of doing this - 1.have an IBOutlet reference in your code. This is created from xcode Interface builder. Once you have this then it fairly straight forward - [iboutlet_foo_object addSubview:copy3]; 2. tag the view that you are interested in. Again tagging a view can be done from xcode Interface builder or from

How to Insert View in Superview's View? (iOS)

江枫思渺然 提交于 2019-12-01 22:50:49
I have the line of code below... How would I modify it to insert the subview in the superview's view named 'foo'? [[self superview] addSubview:copy3]; There are more than 1 ways of doing this - 1.have an IBOutlet reference in your code. This is created from xcode Interface builder. Once you have this then it fairly straight forward - [iboutlet_foo_object addSubview:copy3]; 2. tag the view that you are interested in. Again tagging a view can be done from xcode Interface builder or from code. After that - Foo *fooObj = [[self superview] viewWithTag:tagInt]; [fooObj addSubview:copy3]; 3.Finally

What type of contents UIViewContentMode mode refers to?

走远了吗. 提交于 2019-11-30 19:14:08
According to the official doc on UIView about the contentMode property: The content mode specifies how the cached bitmap of the view’s layer is adjusted when the view’s bounds change What's defined the content in this definition? Is it a sub view or when we have define a background color for a view for example. My very first guess was that it should apply at least for the subviews in a view, but for example the following code snippet will not give me the expected result when playing with the UIViewContentModeCenter tag: UIView* redView = [[UIView alloc] initWithFrame:CGRectMake(80, 80, 150,

Show UIView with buttons over keyboard, like in Skype,Viber messengers (Swift, iOS)

眉间皱痕 提交于 2019-11-30 15:34:35
问题 I want to create attachments view, that places under input accessory view, over keyboard, like in Skype App or Viber: I already asked such question here, but suggested solution for this question was not so elegant, because when i drag my scroll view to the top, i want to my Attachment UIView move down with keyboard (I use UIScrollViewKeyboardDismissModeInteractive). So i create a function, that find out the view, where keyboard and my custom input accessory view are placed: func

Show UIView with buttons over keyboard, like in Skype,Viber messengers (Swift, iOS)

旧时模样 提交于 2019-11-30 14:16:35
I want to create attachments view, that places under input accessory view, over keyboard, like in Skype App or Viber: I already asked such question here , but suggested solution for this question was not so elegant, because when i drag my scroll view to the top, i want to my Attachment UIView move down with keyboard (I use UIScrollViewKeyboardDismissModeInteractive). So i create a function, that find out the view, where keyboard and my custom input accessory view are placed: func findKeyboardView() -> UIView? { var result: UIView? = nil let windows = UIApplication.sharedApplication().windows