Search Results

Search found 5 results on 1 pages for 'khanzor'.

Page 1/1 | 1 

  • UITableView with background UIImageView hides table controls

    - by Khanzor
    I am having a problem setting the background of UITableView to a UIImageView (see below for why I am doing this), once the view is set, it works fine, and scrolls with the UITableView, but it hides the elements of the Table View. I need to have a UIImageView as the background for a UITableView. I know this has been answered before, but the answers are to use: [UIColor colorWithPatternImage:[UIImage imageNamed:@"myImage.png"]]; Or something like (which I need to use): UIImageView *background = [MainWindow generateBackgroundWithFrame:tableView.bounds]; [tableView addSubview:background]; [tableView sendSubviewToBack:background]; The reason I need to use the latter is because of my generateBackgroundWithFrame method, which takes a large image, and draws a border around that image to the dimensions specified, and clips the remainder of the image: + (UIImageView *) generateBackgroundWithFrame: (CGRect)frame { UIImageView *background = [[[UIImageView alloc] initWithFrame:frame] autorelease]; background.image = [UIImage imageNamed:@"globalBackground.png"]; [background.layer setMasksToBounds:YES]; [background.layer setCornerRadius:10.0]; [background.layer setBorderColor:[[UIColor grayColor] CGColor]]; [background.layer setBorderWidth:3.0]; return background; } Please note: I understand that this might poorly effect performance, but I don't have the resources to go through and make those images for each potential screen in the app. Please do not answer this question with a mindless "you shouldn't do this" response. I am aware that it is possibly the wrong thing to do. How do I show my UITableView control elements? Is there something that I am doing wrong in my delegate? Here is a simplified version: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectMake(20, 20, 261, 45) reuseIdentifier:CellIdentifier] autorelease]; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; UIImage *rowBackground; NSString *imageName = @"standAloneTVButton.png"; rowBackground = [UIImage imageNamed:imageName]; UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 5, 300, 200)]; textView.backgroundColor = [UIColor clearColor]; textView.textColor = [UIColor blackColor]; textView.font = [UIFont fontWithName:@"Helvetica" size:18.0f]; Purchase *purchase = [[PurchaseModel productsPurchased] objectAtIndex:indexPath.row]; textView.text = [purchase Title]; selectedTextView.text = textView.text; UIImageView *normalBackground = [[[UIImageView alloc] init] autorelease]; normalBackground.image = rowBackground; [normalBackground insertSubview:textView atIndex:0]; cell.backgroundView = normalBackground; [textView release]; } return cell; }

    Read the article

  • UITableViewCells appear behind backgroundView

    - by Khanzor
    I am having a problem setting the background of UITableView to a UIImageView (see below for why I am doing this), once the view is set, it works fine, and scrolls with the UITableView, but it hides the elements of the Table View. I need to have a UIImageView as the background for a UITableView. I know this has been answered before, but the answers are to use: [UIColor colorWithPatternImage:[UIImage imageNamed:@"myImage.png"]]; Or something like (which I need to use): UIImageView *background = [MainWindow generateBackgroundWithFrame:tableView.bounds]; [tableView addSubview:background]; [tableView sendSubviewToBack:background]; The reason I need to use the latter is because of my generateBackgroundWithFrame method, which takes a large image, and draws a border around that image to the dimensions specified, and clips the remainder of the image: + (UIImageView *) generateBackgroundWithFrame: (CGRect)frame { UIImageView *background = [[[UIImageView alloc] initWithFrame:frame] autorelease]; background.image = [UIImage imageNamed:@"globalBackground.png"]; [background.layer setMasksToBounds:YES]; [background.layer setCornerRadius:10.0]; [background.layer setBorderColor:[[UIColor grayColor] CGColor]]; [background.layer setBorderWidth:3.0]; return background; } Please note: I understand that this might poorly effect performance, but I don't have the resources to go through and make those images for each potential screen in the app. Please do not answer this question with a mindless "you shouldn't do this" response. I am aware that it is possibly the wrong thing to do. How do I show my UITableView control elements? Is there something that I am doing wrong in my delegate? Here is a simplified version: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectMake(20, 20, 261, 45) reuseIdentifier:CellIdentifier] autorelease]; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; UIImage *rowBackground; NSString *imageName = @"standAloneTVButton.png"; rowBackground = [UIImage imageNamed:imageName]; UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 5, 300, 200)]; textView.backgroundColor = [UIColor clearColor]; textView.textColor = [UIColor blackColor]; textView.font = [UIFont fontWithName:@"Helvetica" size:18.0f]; Purchase *purchase = [[PurchaseModel productsPurchased] objectAtIndex:indexPath.row]; textView.text = [purchase Title]; selectedTextView.text = textView.text; UIImageView *normalBackground = [[[UIImageView alloc] init] autorelease]; normalBackground.image = rowBackground; [normalBackground insertSubview:textView atIndex:0]; cell.backgroundView = normalBackground; [textView release]; } return cell; }

    Read the article

  • Quickly check which part of the page lifecycle a control is in

    - by Khanzor
    Is there any way to check what events have fired during the asp.net webforms page/control lifecycle? I know that I can manually add handlers for each event, but that seems a bit ... inefficient. Is there a visualiser, or a property that I can check that will tell me whether these events have fired? EDIT The reason I want to know this is that I am overriding the ViewState property of a custom control, and the viewstate disappears at some point, and I'd like to know at which point in the page lifecycle it is being overriden.

    Read the article

  • Where can I get a machine readable representation of world currencies and their symbols?

    - by Khanzor
    I'm using ASP.Net and would like to display currencies based on a country. I've had a look at http://www.xe.com/symbols.ph, http://www.xe.com/iso4217.php and http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm Is there anywhere I can get something that I can load into a database? Or is there something built in to SQL Server 2005/ASP.Net to help with this?

    Read the article

1