Search Results

Search found 369 results on 15 pages for 'subview'.

Page 2/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Warning generated by UIButton setting code

    - by Spider-Paddy
    I have a for loop setting the background images on buttons, basically the buttons are thumbnail previews of different items & can't be set statically, however the code gives an warning because it runs through all the UIViews but then calls setBackgroundImage which does not apply to all views. The warning is an irritation, I understand what it's complaining about, how can I get rid of it? (I don't want to turn off the warning, I want to fix the problem) // For loop to set button images for (UIView *subview in [self.view subviews]) // Loop through all subviews { // Look for the tagged buttons, only the 8 tagged buttons & within array bounds if((subview.tag >= 1) && (subview.tag <= 8) && (subview.tag < totalBundles)) { // Retrieve item in array at position matching button tag (array is 0 indexed) NSDictionary *bundlesDataItem = [bundlesDataSource objectAtIndex:(subview.tag - 1)]; // Set button background to thumbnail of current bundle NSString *picAddress = [NSString stringWithFormat:@"http://some.thing.com/data/images/%@/%@", [bundlesDataItem objectForKey:@"Nr"], [bundlesDataItem objectForKey:@"Thumb"]]; NSURL *picURL = [NSURL URLWithString:picAddress]; NSData *picData = [NSData dataWithContentsOfURL:picURL]; // Warning is generated here [subview setBackgroundImage:[UIImage imageWithData:picData] forState:UIControlStateNormal]; } }

    Read the article

  • Adding a subview to UITableCellView

    - by hanno
    I want to add a subview to my UITableCellView subclass. However, non of the provided views in the class seem to be able to do exactly what I was looking for. I basically want to add my own background view, filling the whole cell. However, if I replace the backgroundView, the style from the grouped table view layout isn't displayed anymore. If I add a subview to backgroundView, the subview is not shown at all. If I add a subview to the contentView, I can't draw behind the accessory icon. What am I missing?

    Read the article

  • Subview appears behind tableview

    - by Banjer
    When I add a subview to my UITableViewController, it seems to be underneath the tableview. I may be loading my subview incorrectly, or calling addSubview in the wrong place. The subview I'm referring to is the red area above the tabbar that also contains the "Click me" button: You can see that the cell lines kind of overlap. Here is where I'm adding the subview in my TableViewController: - (void)viewDidLoad { [super viewDidLoad]; CGRect hRect = CGRectMake(0, 170, 320, 480); HomeScreenOverlayView *homeView = [[HomeScreenOverlayView alloc] initWithFrame:hRect]; [self.tableView addSubview:homeView]; [homeView release]; } Any ideas? Thanks!

    Read the article

  • UITableView details as a subview

    - by Leonardo
    Hi all, I have a UITableView in iPhone with enough cell to make it scrollable. I would like to have a subview display whenever I click on a cell, rather than using the navigation controller behaviour. The problem is that I cannot calculate the CGRect exactly to have the subview always centered in page, because the CGRect is calculated from top of table, and if I scroll table and click cell, the subview will be added out of screen. The solution could be easy, but I don't know if it's possible: identify the portion of the current viewable area of the UITableView and obtain in some way the frame and therefore origin and size, then build a subview based on such coordinates. Do you think it's possible without writing not too much code ? thanks Leonardo

    Read the article

  • Prevent subview from scrolling in a UIScrollView

    - by jbrennan
    I have a UIScrollView subclass with a certain subview I'd like to prevent from scrolling (while all the other subviews scroll as normal). The closest example to this I can think of is UITableView's "index strip" on the right side (look in the Contacts app to see an example). I am guessing this is a subview of the table (scrollview) but it does not move as the user scrolls. I can't seem to make my subview stay put! How can I accomplish this?

    Read the article

  • How to disable subView in tableViewCell iPhone

    - by user1304842
    every one. I'm a new developer for iphone. I want to not get a event for a subView in a tableCell. It it clear, that how to enable/disable the selected a view. When i use "subView.userInteractionEnabled = NO;" method, the subview send the event to parent view. At the result, when i click the subview, example the buttonView in tableViewCell, The tableViewcell captured the event. I don't allow this. How can i do that? Please help me.

    Read the article

  • CALayer Border is appearing above subview (Z-order related, I think)

    - by kurisukun
    I have searched but could not find the reason for this behavior. I have a UIButton whose image I am setting. Here is how the button should appear. Note that this is just a photoshop of the intended button design: Essentially, it is a square custom UIButton with a white border and a little surrounding shadow. In the upper right corner, there is a "X" mark, that will be added programmatically as a subview. Here is the screenshot of the button within the actual app. At this point, I have only added a shadow and the X mark as a subview: How, when I try to add the white border, here is what it looks like: It seems that the white border is appearing above the X mark sublayer. I don't know why. Here is the code that I am using: // selectedPhotoButton is the UIButton with UIImage set earlier // At this point, I am adding in the shadow [selectedPhotoButton layer] setShadowColor:[[UIColor lightGrayColor] CGColor]]; [[selectedPhotoButton layer] setShadowOffset: CGSizeMake(1.0f, 1.0f)]; [[selectedPhotoButton layer] setShadowRadius:0.5f]; [[selectedPhotoButton layer] setShadowOpacity:1.0f]; // Now add the white border [[selectedPhotoButton layer] setBorderColor:[[UIColor whiteColor] CGColor]]; [[selectedPhotoButton layer] setBorderWidth:2.0]; // Now add the X mark subview UIImage *deleteImage = [UIImage imageNamed:@"nocheck_photo.png"]; UIImageView *deleteMark = [[UIImageView alloc] initWithFrame:CGRectMake(53, -5, 27, 27)]; deleteMark.contentMode = UIViewContentModeScaleAspectFit; [deleteMark setImage:deleteImage]; [selectedPhotoButton addSubview:deleteMark]; [deleteMark release]; I don't understand why the border is appearing above the deleteMark subview. Is there any way to get the intended effect? Thank you!

    Read the article

  • tabbarcontroller as a subview

    - by Boaz
    Hi I have a main view screen with navcontroller in my app with two UIbuttons. Now i want that when I press one button a subview will be pushed. this I know how to do. The problem is that I want this subview to be with tabbarcontroller. I know how to implement tabbar on the main views (within the app delegate), but I have really hard time to do this as a subview.. How should I implement this? Thanks.

    Read the article

  • iPhone - dealloc subview UIViewController when removeFromSuperview

    - by bbullis21
    I have several buttons on my main UIViewController (main menu) that creates and adds a subview UIViewController on top of the main menu. When I remove the subview the memory from that controller is not released. How can I release that subviews memory instantly? Does anyone have an example? This would solve all my problems! Thanks in advance. Here is how I add a subview if((UIButton *) sender == gameClassicBtn) { GameClassic *gameClassicController = [[GameClassic alloc] initWithNibName:@"GameClassic" bundle:nil]; self.gameClassic = gameClassicController; [gameClassicController release]; [self.view insertSubview:gameClassicController.view atIndex:1]; }

    Read the article

  • determine if point on screen is within specific UIScrollView subview

    - by Kyle
    A UIScrollView contains several UIView objects; how can I tell if a point on the screen not generated by touches is within a specific subview of the scrollview? so far atempts to determine if the point is in the subview always return the first subview in the subviews array of the parent scrollview, ie the coordinates are relative to the scrollview, not the window. Here's what I tried (edited) -(UIView *)viewVisibleInScrollView { CGPoint point = CGPointMake(512, 384); for (UIView *myView in theScrollView.subviews) { if(CGRectContainsPoint([myView frame], point)) { NSLog(@"In View"); return myView; } } return nil; }

    Read the article

  • UIViewController remove subview

    - by ghiboz
    Hi all! I add a view as subview of my uiviewcontroller like this: // into my ViewController: UIImageView *imView =[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"img.jpg"]]; imView.frame = CGRectMake(2, 46, 1020, 720); [self.view addSubview:imView]; now, with another button I wish remove the imView from the subview chain.. how can I do to do this?? thanks

    Read the article

  • How to reference object values from subview?

    - by Frank Martin
    I have a ViewController and add programmatically a subview. During the initialization of the subview (initWithFrame) i want to set some attributes to values according to attributes that belong to another ViewControllers Child-Object (not a view). -(id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // The following is kind of what i want self.myAttribute = [self.viewController.otherObject otherValue]; } return self; } Thanks in advance for any answers and comments how to improve the question. Frank

    Read the article

  • Bring a subview to the top on mouseDown: AND keep receiving events (for dragging)

    - by d11wtq
    Ok, basically I have a view with a series of slightly overlapping subviews. When a subview is clicked, it moves to the top (among other things), by a really simple two-liner: -(void)mouseDown:(NSEvent *)theEvent { if (_selected) { // Don't do anything this subview is already in the foreground return; } NSView *superview = [self superview]; [self removeFromSuperview]; [superview addSubview:self position:NSWindowAbove relativeTo:nil]; } This works fine and seems to be the "normal" way to do this. The problem is that I'm now introducing some drag logic to the view, so I need to respond to -mouseDragged:. Unfortunately, since the view is removed from the view hierarchy and re-added in the process, I can have the view come to the foreground and be dragged in the same mouse action. It only drags if I leave go of the mouse and click on the view again, since the second click doesn't do any view hierarchy juggling. Is there anything I can do that will allow the view to move to the foreground like this, AND continue to receive the subsequent -mouseDragged: and -mouseUp: events that follow? I started along the lines of thinking of overriding -hitTest: in the superview and intercepting the mouseDown event in order to bring the view to the foreground before it actually receives the event. The problem here is, from within -hitTest:, how do I distinguish what type of event I'm actually performing the hit test for? I wouldn't want to move the subview to the foreground for other mouse events, such as mouseMoved etc.

    Read the article

  • Processing a method after the view has loaded..

    - by Susanth
    Hi ! I have implemented a subview which is supposed to load immediately when I click a button in the parent view. After loading the subview(which is basically holding an activityindicator), the program is supposed to process a method(which gets data from a server, so takes time) in it. However, I am unable to do it. What happens now is, when I click the button on the parent view, it processes the method first and only after that does the subview load on screen. Why is this so? Is there any specific functions I could use to make my method load only after the view has loaded?

    Read the article

  • Click event of a button which is subview of an image view in xcode

    - by Christina
    in my app i have an image view and above that i added an button.And also in button click event i am calling a method.But i am unable to click on the button .whenever i try to click the button then the row of the table vie win which my image view is present is selected .Is there any method from which i can get the click event of the button which is placed on the image view.I do not want to use UIbuttons for setting the images in place of image view .Also if i am adding button as a subview of the table view then the click event is working but when i change the subview to image view then i get unsatisfactory result.Please help. Thanks, Christy

    Read the article

  • what's the right way to cause a subview to redraw when the device orientation changes?

    - by RobertL
    I have a view controller with a view and one subview. When the device orientation changes the view auto-redraws but the subview doesn't. If I explicitly do [subview setNeedsDisplay] it redraws but I don't have a logical place to put that call in my code. And, since I don't have to explicitly tell the view to redraw, it seems counter-intuitive to tell the subview to redraw. Is there a way to make the subview auto-redraw when the view redraws?

    Read the article

  • Blurry UILabel as programmatic subview of UITableViewCell contentView

    - by Alex Reynolds
    I am adding a UILabel instance as a subview of my custom UITableViewCell instance's contentView. When I select the cell, the row is highlighted blue, except for the background of the label. The label text is sharp. When I set the label and content view backgroundColor property to [UIColor clearColor], the label text becomes blurry. How do I set the label background color to be clear, to allow the row highlight to come through, while still keeping the label text sharp? One suggestion I read elsewhere was to round the label's frame values, but this did not have any effect. CODE Here is a snippet of my custom UITableViewCell subview's -setNeedsLayout method: UILabel *_objectTitleLabel = [[UILabel alloc] initWithFrame:CGRectNull]; _objectTitleLabel.text = [self.awsObject cleanedKey]; _objectTitleLabel.font = [UIAppDelegate defaultObjectLabelFont]; _objectTitleLabel.highlightedTextColor = [UIColor clearColor]; //[UIAppDelegate defaultLabelShadowTint]; _objectTitleLabel.backgroundColor = [UIColor clearColor]; //[UIAppDelegate defaultWidgetBackgroundTint]; _objectTitleLabel.frame = CGRectMake( kCellImageViewWidth + 2.0 * self.indentationWidth, 0.5 * (self.tableView.rowHeight - 1.5 * kCellLabelHeight) + kCellTitleYPositionNudge, contentViewWidth, kCellLabelHeight ); _objectTitleLabel.frame = CGRectIntegral(_objectTitleLabel.frame); _objectTitleLabel.tag = kObjectTableViewCellTitleSubviewType; //NSLog(@"_objectTitleLabel: %@", NSStringFromCGRect(_objectTitleLabel.frame)); [self.contentView addSubview:_objectTitleLabel]; [_objectTitleLabel release], _objectTitleLabel = nil; ... self.contentView.backgroundColor = [UIAppDelegate defaultWidgetBackgroundTint]; self.contentView.clearsContextBeforeDrawing = YES; self.contentView.autoresizesSubviews = YES; self.contentView.clipsToBounds = YES; self.contentView.contentMode = UIViewContentModeRedraw;

    Read the article

  • ipad subview not loading before code is executing

    - by ethan Criss
    I have a command that should be loading a subview before a particular piece of time intensive code executes. However the command runs, the timely code executes and then the subview shows up. Is there anything I can do to fix this problem? progressViewController = [[ProgressView alloc] initWithNibName:@"ProgressView" bundle:[NSBundle mainBundle]]; [self.view addSubview:[progressViewController view]]; NSString *name=@"guy"; NSString *encodedName =[[NSString alloc] init]; int asci; for(int i=0; i < [name length]; i++) { //NSLog(@"1"); asci = [name characterAtIndex:i]; NSString *str = [NSString stringWithFormat:@"%d,", asci]; encodedName =[encodedName stringByAppendingFormat: str]; } NSString *urlString = [NSString stringWithFormat:@"someurl.com"]; NSURL *theUrl = [[NSURL alloc] initWithString:urlString]; NSString *result=[NSString stringWithContentsOfURL:theUrl]; result = [result substringFromIndex:61]; result = [result substringToIndex:[result length] - 20]; NSLog(result); outLab.text=result; [[progressViewController view] removeFromSuperview];

    Read the article

  • Apple Interface Builder: adding subview to UIImageView

    - by kpower
    I created UIImageView with the help of Interface Bulder. Now I want to place label inside it (as its subview). In code I can type something like: [myUIImageView addSubview:myUILabel]; But can I do it with the help of IB? I found the solution for UIView, but can't find something similar for UIImageView.

    Read the article

  • UIButton as a subview in UILable

    - by Jayshree
    hi. i am trying to dynamically add a UIbutton as a subview to UIlable. but i am not able to click the button. it seems that the lable doesnt allow the buttonTapped event to occur. can somebody explain what exactly is happening here. and can anybody give me an alternative for this. thnx

    Read the article

  • subview is not added immediately (iphone)

    - by Jonathan
    When the return button on the keyboard for a textfield is tapped I want to add a UIView, then connect to a website with NSURlConnection sendsynchronousrequest and I have the code in that order But when I run in the simulator (I can't run on device) the connection is run first then the subview is added (ie the opposite of the order of the code) Why is this and how can stop it, because I want the view to added, then the connection done and then the view removed.

    Read the article

  • UIButton as a subview in UILabel

    - by Jayshree
    hi. i am trying to dynamically add a UIbutton as a subview to UIlable. but i am not able to click the button. it seems that the lable doesnt allow the buttonTapped event to occur. can somebody explain what exactly is happening here. and can anybody give me an alternative for this. thnx

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >