subviews

Adding a UIView's to the Subview which is already added to the MainView

杀马特。学长 韩版系。学妹 提交于 2019-12-11 05:30:16
问题 The structure is like this,.. *) MainView 1) viewLocations(UIVIEW) // this one is adding fine a) viewBangalore b) viewHyderbad Actually I'm doing a iPad App , in one of the UIViewController I've used a UiTableController as a sliding view to pick the Locations . According to locations pick ,need to display UiView's. viewLocations --> CGRectMake(0,108,588,533) Here My code is : if (_detailItem) { Location=[_detailItem description]; if ([Location isEqual:@"Bangalore"]) { self.viewLocBangalore= [

iOS: issues with UIGestureRecognisers vs Subviews

送分小仙女□ 提交于 2019-12-10 22:34:58
问题 I have written following code to attach gesture recogniser to multiple imageviews. [imageview1 setUserInteractionEnabled:YES]; [imageview1 setMultipleTouchEnabled:YES]; [imageview2 setUserInteractionEnabled:YES]; [imageview2 setMultipleTouchEnabled:YES]; [imageview3 setUserInteractionEnabled:YES]; [imageview3 setMultipleTouchEnabled:YES]; [imageview4 setUserInteractionEnabled:YES]; [imageview4 setMultipleTouchEnabled:YES]; [imageview5 setUserInteractionEnabled:YES]; [imageview5

Multiple UIView's overlapping

别来无恙 提交于 2019-12-10 10:29:30
问题 I am creating multiple custom UIView's in a custom UIView . The creation of the custom sub-views is ok. They look like this: The draw method is quite straightforward: [[UIColor brownColor] set]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(ctx, 5.0f); CGContextBeginPath(ctx); CGContextMoveToPoint(ctx, 0.0f, 0.0f); CGContextAddLineToPoint(ctx, 100.0f, 0.0); CGContextAddLineToPoint(ctx, 130.0f, 25.0f); CGContextAddLineToPoint(ctx, 100.0f, 50.0f);

UIScrollView does not work with EXC_BAD_ACCESS

青春壹個敷衍的年華 提交于 2019-12-08 03:52:50
问题 I have a scrollview that is subview of view, and has the subviews. The problem is this: the scrollView came with the black background (as I have set transparent) and also does not work. The scrollView is connected with an IBOutlet . I redid the XIB 2 times, what needs fixing? When I add the scrollView as subview of view: [self.view addSubview:self.scrollView]; I get this error during runtime: 0x132b61: calll 0x132b66; CA::Layer::ensure_transaction_recursively(CA::Transaction*) + 14 EXC_BAD

Swift - Retrieving subviews

我的梦境 提交于 2019-12-05 22:20:33
问题 In my application I am adding labels to the view and then I am attempting to clear particular labels from the view when a button is clicked and am running into an error when trying to retrieve the subviews: class FirstViewController: UIViewController { @IBAction func btnAddTask_Click(sender: UIButton){ var subViews = self.subviews.copy() } } I get the error: 'FirstViewController' does not have a member named 'subviews' How can I get the subviews of the current view? 回答1: UIViewController

How to disable “highlight subviews” message for UIView/UIViewController in iOS SDK?

痴心易碎 提交于 2019-12-04 08:31:32
问题 I want to use the default highlight on a UITableViewCell when it is tapped. However, I do not want custom subviews (and their subviews) to receive the message to update their highlighted states and therefore disrupt the backgroundColor property. Edit By "subview" I mean any UIView subclass, not just UITableViewCell s. Perhaps this hypothetical situation will better articulate what I'm looking for : I have one UITableViewCell . Call it c . I then add one UIView (call it v ) as a subview of c .

Remove all the subviews from a UIScrollView?

我是研究僧i 提交于 2019-12-03 06:28:34
问题 How do I remove all of the subviews from a UIScrollview? 回答1: Let scrollView be an instance of UIScrollView . In Objective-C, it's pretty easy. Just call makeObjectsPerformSelector: , like so: Objective-C: [scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; In Swift, you don't get that runtime access, so you have to actually handle the iteration yourself. Swift: A concise version, from here: scrollview.subviews.map { $0.removeFromSuperview() } A more descriptive

Remove all the subviews from a UIScrollView?

牧云@^-^@ 提交于 2019-12-02 19:59:08
How do I remove all of the subviews from a UIScrollview? koo Let scrollView be an instance of UIScrollView . In Objective-C, it's pretty easy. Just call makeObjectsPerformSelector: , like so: Objective-C: [scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; In Swift, you don't get that runtime access, so you have to actually handle the iteration yourself. Swift: A concise version, from here : scrollview.subviews.map { $0.removeFromSuperview() } A more descriptive way to do this (from here ) assumes scrollview.subviews : let subviews = self.scrollView.subviews for

xcode Removing Some Subviews from view

北城以北 提交于 2019-11-30 07:04:34
Greetings all, I am a noob and I have been trying to work through this for a few days. I am adding images to a view via UItouch. The view contains a background on top of which the new images are add. How do I clear the images I am adding from the subview, without getting rid of the UIImage that is the background. Any assistance is greatly appreciated. Thanks in Advance. here is the code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *) event { NSUInteger numTaps = [[touches anyObject] tapCount]; if (numTaps==2) { imageCounter.text =@"two taps registered"; //__ remove images UIView*

Autolayout and subviews

混江龙づ霸主 提交于 2019-11-29 22:58:51
I am using the iAd suite with storyboards from Apple, as per this link... Apple iAd Storyboard documentation It all works fine until I turn autolayout on. It builds fine but crashes on running. The output I get is: 2013-08-24 12:06:36.138 TabbedBanner[7272:c07] * Assertion failure in -[UIView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIView.m:5781 2013-08-24 12:06:36.139 TabbedBanner[7272:c07] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after sending -viewDidLayoutSubviews to the view controller.