Search Results

Search found 1125 results on 45 pages for 'uiview'.

Page 11/45 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Black Corners On Grouped UITableViewCells Only After Navigation Pops

    - by coneybeare
    I am not graphics expert but I somehow managed to make some good looking custom grouped UITableViewCells by setting the background view to a backgroundView with some CG code. In all SDK's up to 3.1.3 (maybe 3.2... I haven't tested on the iPad) this was working great, but I think a more recent SDK has introduced a change in the way graphics are cached offscreen. Upon first render, everything is great: The drawing is fine and the corners are transparent. If I push a couple of view controllers on the navigation stack and come back, there are now black corners that appear in the views: BEFORE && AFTER I have tons of code, most of which is written up here. I have tried tweaking to the best of my ability, looking at the docs for applicable changes, but after at least 8 hours in I still cannot find what might cause this. I have tried setting every view I can think of to be backgroundColor=clearColor and opaque=NO What else am I missing? Any debugging tips? UPDATE: I have some debug code in viewDidAppear that prints the backgroundColor and class description of all the subviews. - (void)debugView:(UIView *)view { DebugLog(@"%@ - %@", view.backgroundColor, [[view class] description]); for (UIView* child in view.subviews) { [self debugView:child]; } } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [DownloadController.networkQueue setSuspended:NO]; for (TTTableViewCell *cell in [self.tableView visibleCells]) { [cell debugView:cell]; } } With this code, I inspect the backgroundColor settings of the cell views on first load, when it is fine, and then again after coming back. There are some differences, but all the colors are still set to be clear. This leads me to believe the issue is underneath the UITableViewCell. UPDATE 2: I have created a simple sample application to highlight the problem here

    Read the article

  • Add a sub-view to a DetailView UIView in iPad

    - by Elisabeth
    I'm creating a split view controller app, the detail view has a segmented control in a navigation bar at the top. Clicking on a segment will add a new view to the detail view with the appropriate information on it (covering up the DetailViewController's default UIView). I've created two new UIViews, corresponding to each segment, and I'm trying to add them to the view like this (in DetailViewController.m): if (exerciseSegmentControl.selectedSegmentIndex == UISegmentedControlNoSegment) { NSLog(@"No segment selected"); } UIView *viewToShow; if (selectedView == 0 && exerciseSegmentControl.selectedSegmentIndex == 1) { viewToShow = exerciseSolutionView; } else { viewToShow = exerciseView; } [self.view addSubview:viewToShow]; I see the view appear, but it's in the wrong place, it is placed at the very top of the window, instead of below the navigation bar. In IB, I've created instances of the views, and I've used the Attributes inspector to specify "Navigation Bar" for top bar, which sets the height of the view correctly. But the view is clearly being added too far up in the window - I see the view below it (the DetailViewController's UIView) peaking out at the bottom (I changed the background color so I know which view I'm seeing). Any tips on how to get the subview I'm adding to get placed correctly in the window? Thanks!

    Read the article

  • Dragging an UIView inside UIScrollView

    - by Sergey Mikhanov
    Hello community! I am trying to solve a basic problem with drag and drop on iPhone. Here's my setup: I have a UIScrollView which has one large content subview (I'm able to scroll and zoom it) Content subview has several small tiles as subviews that should be dragged around inside it. My UIScrollView subclass has this method: - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { UIView *tile = [contentView pointInsideTiles:[self convertPoint:point toView:contentView] withEvent:event]; if (tile) { return tile; } else { return [super hitTest:point withEvent:event]; } } Content subview has this method: - (UIView *)pointInsideTiles:(CGPoint)point withEvent:(UIEvent *)event { for (TileView *tile in tiles) { if ([tile pointInside:[self convertPoint:point toView:tile] withEvent:event]) return tile; } return nil; } And tile view has this method: - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInView:self.superview]; self.center = location; } This works, but not fully correct: the tile sometimes "falls down" during the drag process. More precisely, it stops receiving touchesMoved: invocations, and scroll view starts scrolling instead. I noticed that this depends on the drag speed: the faster I drag, the quicker the tile "falls". Any ideas on how to keep the tile glued to the dragging finger? Thanks in advance!

    Read the article

  • EXC_BAD_ACCESS on button press for button dynamically added to UIView within UIScrollView

    - by alan
    OK. It's an iPad app. Within the DetailViewController I have added a UIScrollView through IB and within that UIScrollView I have added a UIView (also added through IB) which holds various dynamically added UITableViews, UILabels and UIButtons. My problem is that I'm getting errors on the UIButton clicks. I have defined this method: - (void)translationSearch:(id)sender { NSLog(@"in transearch"); [self doSearch]; } This is how I'm adding the UIButton to the UIView: UIButton *translationButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; translationButton.frame = CGRectMake(6, 200, 200, 20); translationButton.backgroundColor = [UIColor clearColor]; [translationButton setTitle:@"testing" forState:UIControlStateNormal]; [translationButton addTarget:self action:@selector(translationSearch:) forControlEvents:UIControlEventTouchUpInside]; [verbView addSubview:translationButton]; Now the button is added to the form without any issue but, when I press it, I am getting an EXC_BAD_ACCESS error. I'm sure it's staring me in the face but I've passed my usual time limit for getting a bug like this fixed so any help would be greatly appreciated. The only thing I can think is the fact that the UIButton is within a UIView which is within a UIScrollView which is within the view controller is somehow causing an issue. Cheers.

    Read the article

  • Can draw on only half of UIView

    - by ydlee777
    Hello. I am trying to draw grid on a UIView on a UIScrollView. The width of UIView is about 1000 pixels. However, I can draw lines only about first 340 pixels of the UIView. Can anyone help me on this? The drawGrid function is - (void)drawRect:(CGRect)rect { NSInteger width = 25 * 5 * 10; NSInteger height = (10 * 2 + 10) * 12; NSInteger i; //Get the CGContext from this view CGContextRef context = UIGraphicsGetCurrentContext(); // Draw rectangle with a blue stroke color and white fill color CGContextSetRGBStrokeColor(context, 0.0, 0.0, 1.0, 1.0); CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1.0); CGContextSetLineWidth(context, 2.0); CGContextAddRect(context, CGRectMake(0.0, 0.0, width, height)); CGContextFillPath(context); // Draw grid with red color CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); // Set the width of the pen mark CGContextSetLineWidth(context, 0.2); for (i = 0; i < height; i += 5) { if (i % 25 == 0) { CGContextSetLineWidth(context, 0.4); // Draw a line CGContextMoveToPoint(context, i, 0.0); CGContextAddLineToPoint(context, i, width); CGContextStrokePath(context); CGContextSetLineWidth(context, 0.2); } else { // Draw a line CGContextMoveToPoint(context, i, 0.0); CGContextAddLineToPoint(context, i, width); CGContextStrokePath(context); } } for (i = 0; i < width; i += 5) { if (i % 25 == 0) { CGContextSetLineWidth(context, 0.4); // Draw a line CGContextMoveToPoint(context, 0.0, i); CGContextAddLineToPoint(context, height, i); CGContextStrokePath(context); CGContextSetLineWidth(context, 0.2); } else { // Draw a line CGContextMoveToPoint(context, 0.0, i); CGContextAddLineToPoint(context, height, i); CGContextStrokePath(context); } } } I am also setting up the UIScrollView and UIView as follows: - (void)viewDidLoad { [super viewDidLoad]; CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); waveScrollView = [[WaveScrollView alloc] initWithFrame:frame]; CGRect waveframe = CGRectMake(0, 0, 25 * 5 * 10, (10 * 2 + 10) * 12); EKGWaveView *ekgWaveView = [[EKGWaveView alloc] initWithFrame:waveframe]; waveScrollView.contentSize = CGSizeMake(waveframe.size.width, waveframe.size.height); waveScrollView.maximumZoomScale = 4.0; waveScrollView.minimumZoomScale = 0.75; waveScrollView.clipsToBounds = YES; waveScrollView.aView = ekgWaveView; [waveScrollView addSubview:ekgWaveView]; waveScrollView.delegate = self; [self.view addSubview:waveScrollView]; } I appreciate any help. Thanks.

    Read the article

  • Problem adding subviews (UIButtons) to subclass of UIImageView

    - by samfu_1
    I'm adding a custom button/keypad to my application. Thus far, I have a UIImageView subclass that contains an animation that slides it from the bottom of the screen, and then back down when the user no longer needs it. I'm having trouble adding UIButtons to this UIImageView, however. Since this is a subclass of UIView, I'm attempting to add buttons to my view via the initWithFrame: method. (slideDown method is the added animation) in my UIImageView Subclass, I have a UIButton ivar object added: -(id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame: frame]) { UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect]; button.frame = CGRectMake(16.0, 20.0, 50.0, 50.0); [button setTitle: @"Go" forState: UIControlStateNormal]; [button addTarget: self action: @selector(slideDown) forControlEvents: UIControlEventTouchUpInside]; self.button1 = button; [self addSubview: button1]; NSLog(@"Button added"); } return self; } In my view controller, I instantiate my UIIMageView Subclass in the -(void)viewDidLoad: method as follows: -(void)viewDidLoad { //other objects init'ed ButtonPad *customPad = [[ButtonPad alloc] initWithImage: [UIImage imageNamed: @"ButtonPad.png"]]; customPad.frame = CGRectMake(0.0, 480.0, 320.0, 300.0); self.buttonPad = customPad; [self.view addSubview: buttonPad]; [customPad release]; [super viewDidLoad]; } My current app allows the view to slide up and down off of the screen without any problems. However, the button never appears. I have also tried adding the button to my buttonPad object by instantiating & adding it as a subView to the buttonPad in my view controller file. This worked... but it didn't allow the button to function. I am wondering: A.) Is it appropriate to add buttons or any subview for that matter to the UIView initWithFrame: method or should I be adding these subviews as a subview to my buttonPad in the view Controller file? B.) Since I am creating a custom button/keypad, am i following a valid approach by using a normal UIViewController or should I be using something like a modal view Controller? ( I have little knowledge about these.)

    Read the article

  • Does mixing Quartz and OpenGL-ES cause big performance degrade??

    - by Eonil
    I have a plan to make a game using OpenGL for 3D world view, and CALayer(or UIView) for HUD UI. It's easy to imagine performance degrade from mixing them, but the document which mention this impact disappeared: http://developer.apple.com/iphone/library/technotes/tn2008/tn2230.html I cannot find the document on current version of SDK reference. And I got this document: http://gamesfromwithin.com/gdc-2010-the-best-of-both-worlds-using-uikit-with-opengl If you experienced about this, please let me know about performance impact on current SDK.

    Read the article

  • Avoid hardcoding iPhone screen size with programmatic view creation

    - by miorel
    Hi, I was looking up how to create a view programmatically and found the following example code: self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; This works great, except I don't like that it hardcodes the size of the screen. Is there a way to look up the size of the screen? An important point someone brought up is that if the app is running during a phone call then the screen will be slightly smaller because of the green "return to call" bar.

    Read the article

  • Convert UIViews made programmatically to UIScrollViews

    - by Scott
    So I have a bunch of UIViews that I made programmatically and placed a bunch of content on (UIButtons, UILabels, UINavigationBars, etc.), and most of these views are going to need to actually be UIScrollViews instead. Now keep in mind I made all these through code not the Interface Builder. What I first tried was to just change each declaration of a UIView to a UIScrollView instead, and that compiled and ran fine, however, they were not scrollable. It's REALLY weird. Here is the code that I change into UIScrollViews, although it doesn't scroll: - (void)loadView { //allocate the view self.view = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; //self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; //set the view's background color self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"MainBG.jpg"]]; [self.view addSubview:[SiteOneController myNavBar1:@"Sites"]]; NSMutableArray *sites = [[NSMutableArray alloc] init]; NSString *one = @"Constution Center"; NSString *two = @"Franklin Court"; NSString *three = @"Presidents House"; [sites addObject: one]; [one release]; [sites addObject: two]; [two release]; [sites addObject: three]; [three release]; NSString *element; int j = 0; for (element in sites) { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; UIFont *myBoldFont = [UIFont boldSystemFontOfSize:20.0]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, b + (j*45), c, d)]; [label setBackgroundColor:[UIColor clearColor]]; label.text = element; label.font = myBoldFont; UIImage *img = [UIImage imageNamed:@"ButtonBase.png"]; [button setImage:img forState:UIControlStateNormal]; //setframe (where on screen) //separation is 15px past the width (45-30) button.frame = CGRectMake(a, b + (j*45), c, d); // [button setTitle:element forState:UIControlStateNormal]; button.backgroundColor = [SiteOneController myColor1]; [button addTarget:self action:@selector(showCCView:) forControlEvents:UIControlEventTouchUpInside]; [button setTag:j]; [self.view addSubview: button]; [self.view addSubview:label]; j++; } } What am I doing wrong?

    Read the article

  • Common header view on top of nib files with Interface builder

    - by Tiago
    Hi, I have a nib file that contains an header that will be used in most of my views, so that I can change it's layout just once when I need. I'd like to know if it's possible to add the header nib view with interface builder, or if I need to do that programmatically and how should it be done. I've thought about setting the subclass of the subview to a UIView subclass that automatically loads the nib file, but I'd like to do that with interface builder. Is that possible?

    Read the article

  • Vector graphics on iPhone

    - by burki
    Hello! How you can use EPS files within your UIView. What do I have to do to display for example a EPS on the iPhone's screen? Do I need to convert it first to a PDF (if yes, how?)? Or are there any other way to bring vector graphics onto the iPhone? That would be very nice. Thanks.

    Read the article

  • Is there an open source UITabbedView component available for the iPhone (iPad) SDK?

    - by smountcastle
    Is there an open source UIView component that supports multiple, dynamic tabbed views for the iPhone (iPad) SDK? I see several apps in the iPad App Store which utilize tabs, one such example is the Atomic Web Browser which provides a tabbed browsing experience (like Safari on the Mac or Firefox). Instead of reinventing this functionality, I'd like to reuse an existing component.

    Read the article

  • Minimize window effect of OS X on the iPhone - Objective-C

    - by ncohen
    Hi everyone, I would like to imitate the minimize window effect of OS X on the UIView's iPhone... I was thinking about making two animations: the first one extend and distort the view and the second one reduce the view! What do you think? My problem is to distort the view! Do you have any idea how I could make the whole thing? Thanks

    Read the article

  • iPhone UIWebView touch cause Toolbar to appear

    - by BahaiResearch.com
    I am trying to have a UI which is a full screen UIWebView. When the view is touched the tool bar appears. I can do everything but get the touchend event in the UIWebView. I have tried putting a UIColor.Clear'd UIView ontop and catching TouchEnd there and passing it on, but would like a better solution. I understand that we are not supposed to subclass the UIWebView from the docs. Ideas?

    Read the article

  • UIScrollView does not scroll

    - by Preston Cheung
    I got a problem about UIScrollView. I am making a custom view which inherits UIView. The view has a UIScrollView on which there are lots of buttons which should scroll left and right. The UIScrollView and buttons can show normally. But I cannot scroll the buttons. Could someone give me some suggestions? Thanks a lot! MZMPhotoCalenderSwitcher.h #import <UIKit/UIKit.h> @interface MZMPhotoCalenderSwitcher : UIView <UIScrollViewDelegate> @property (strong, nonatomic) UIScrollView *topSwitcher; @end MZMPhotoCalenderSwitcher.m - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.topSwitcher = [[UIScrollView alloc] initWithFrame:CGRectMake(0, LABEL_HEIGHT + VIEW_Y, self.view.bounds.size.width, TOP_SWITCHER_HEIGHT)]; self.topSwitcher.backgroundColor = [UIColor greenColor]; self.topSwitcher.pagingEnabled = YES; self.topSwitcher.showsHorizontalScrollIndicator = NO; self.topSwitcher.showsVerticalScrollIndicator = NO; [self add:3 ButtonsOnView:self.topSwitcher withButtonWidth:44.8f andHeight:20.0f]; } - (void)add:(int)num ButtonsOnView:(UIScrollView *)view withButtonWidth:(CGFloat)width andHeight:(CGFloat)height { CGFloat totalTopSwitcherWidth = num * width; [view setContentSize:CGSizeMake(totalTopSwitcherWidth, view.bounds.size.height)]; CGFloat xOffset = 0.0f; for (int i=1; i<=num; i++) { UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setFrame:CGRectMake(xOffset, 0, width, height)]; xOffset += width; [button setTitle:[NSString stringWithFormat:@"%d", i] forState:UIControlStateNormal]; button.titleLabel.font = [UIFont systemFontOfSize:10]; [button setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; [button setTitleColor:[UIColor blackColor] forState:UIControlStateSelected]; [button setTag:i]; [button addTarget:self action:@selector(buttonEvent) forControlEvents:UIControlEventTouchUpInside]; if (i % 2 == 0) [button setBackgroundColor:[UIColor yellowColor]]; else [button setBackgroundColor:[UIColor redColor]]; [view addSubview:button]; } }

    Read the article

  • iPhone: keep text looking good after scale transform applied?

    - by Greg Maletic
    I'm applying a scale transform to a UIView that draws a number. (The number is literally being drawn with drawInRect; no UILabel in sight.) The scale transform makes the view smaller by quite a bit...say, 80% smaller. The resulting number looks a little "chunky". Is there a way that I can keep my text looking nice and anti-aliased, the way it's supposed to look? Thanks.

    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

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >