uiview

Auto Layout center UIView above another UIView at its center

孤街浪徒 提交于 2020-01-06 01:32:12
问题 I have a UIView ( popup ) and multiple UIButton s ( sender ). If I touch the sender I would like to center the popup at the coordinates of the sender . However, as of Auto Layout the popup always moves back to the initial position at refresh. I understand that I have to use constraints and change those programmatically. Unfortunately I don't know how I can adjust below code with constraints. Especially as the popup is larger as the sender . Could anybody give me some advice on how to move

Adding CPTGraphHostingView as a subview

╄→尐↘猪︶ㄣ 提交于 2020-01-05 18:25:10
问题 There isn't a lot of questions about this and none of them were answered in a way that could solve my problem, still sorry if I'm asking something that was asked already. My problem is that I'd like to use core plot to draw a graph inside a view. So I add the view on IB in my appviewcontroller.xib , but thenI can't find how to link that specific zone I just defined on IB to the file's owner. A bit of precision: I managed to use core plot in another application, when it was the main view, but

How to add UIView subviews in a view aligned like 3x3 table

南楼画角 提交于 2020-01-05 14:11:29
问题 I have created a main View and in that I add 9 UIMyView that I subclassed from UIView. I add instances of that UIMyViews using NSBundle to load the nib file and addSubview in the main view controller, of course all of these views are appeared in the upper left corner of the super view one hiding the other and the last one to be visible, which either I need to position them somehow using points in super view or create something like a table and add to its cells the UIMyViews?! Imagine you have

How to add UIView subviews in a view aligned like 3x3 table

ぃ、小莉子 提交于 2020-01-05 14:11:17
问题 I have created a main View and in that I add 9 UIMyView that I subclassed from UIView. I add instances of that UIMyViews using NSBundle to load the nib file and addSubview in the main view controller, of course all of these views are appeared in the upper left corner of the super view one hiding the other and the last one to be visible, which either I need to position them somehow using points in super view or create something like a table and add to its cells the UIMyViews?! Imagine you have

EAGLView to UIImage timing question

你说的曾经没有我的故事 提交于 2020-01-05 07:51:57
问题 I have a EAGLView that I wish to convert into a UIImage. I can do this with the solution posted here: How to get UIImage from EAGLView? However, I can only accomplish this if a small amount of time has gone by between the creation of the EAGLView and the UIImage. This code, which creates a EAGLView, and then a UIImageView right afterwards, does not work: EAGLView *EAGLphoto = [[EAGLView alloc] initWithImage:photo.workAreaImage]; [theWorkArea.photoArea1 addSubview:EAGLphoto]; //I put a

Autolayout in UIView where is safe to ask computed layout values?

不想你离开。 提交于 2020-01-05 07:48:51
问题 I've got this issue. I'm using a collection view as a subview of the main view of a UIViewController . The collection view is pinned to the superview size, thus it has 4 constraints for lead,trail, top and bottom with constants equal to 0. The cell is a subclass to UICollectionViewCell and is composed by: first header view second header view UITableView The collection view cell is loaded from xib and the interface of the views is made for 4 inches devices. The first header view is pinned at

Expandable and Collapsable UITableViewCell with Custom Views

旧城冷巷雨未停 提交于 2020-01-05 07:41:52
问题 Not Getting any Idea on how to solve this .... Ok. This is my custom UITableViewCell with three different Child Views . That you can see with different colors. Here , Height of my second Child View is dynamic and be calculated at run time. I am using -heightForRowAtIndexPath to set the height of UITableViewCell . What I have tried : I set the Outlets of Child Views and then in -heightForRowAtIndexPath , I used this Code... middleView.frame = CGRectMake(0, 60.0, 750.0, size); footerView.frame

iOS - how to forward touches to the underlying uiview

≡放荡痞女 提交于 2020-01-05 07:40:50
问题 I have 3 UIViews of the same size stacked on top of each other. The topmost is transparent and only used for detecting touches. The type of touch detected will determine which of the other two underlying views I want to receive the touch events. Once the topmost view is finished with the touch, I need to forward the touch events to the correct underlying view. How can I do that? EDIT - I am adding my touch detection code. This is within MainViewController, whose view contains all 3 subviews.

UIView not transparent to all views underneath

不打扰是莪最后的温柔 提交于 2020-01-05 05:48:09
问题 I am working on an iOS application and I am having the following problem: I have a UIView which background color has alpha = 0.8 , but I do not want it to be see-through for all elements underneath it. I am making it transparent by adding the following code to its Draw(CGRect rect) method: var gctx = UIGraphics.GetCurrentContext(); gctx.AddEllipseInRect(new CGRect(rect.Location, rect.Size)); gctx.SetFillColor(UIColor.FromRGB(255, 255, 255).ColorWithAlpha(0.8f).CGColor); However, in this way

Circular UIView from nib with animated and non-animated changes

谁说我不能喝 提交于 2020-01-05 04:38:09
问题 I'd like to make a custom view that acts just like a UIView when I make bounds, frame, or transform changes: if I change these things with an assignment, the just change in a single frame, if I change them in a UIView animation block, they animate from their current state to the state I set. I'd like to define the view and it's subviews in IB, and set constraints there. The following code works coming out of the nib with constraints, and successfully sets bounds/frame/transform with