Note that there are some explanatory texts on larger screens.

plurals
  1. POMKMapView inside a UITableViewCell
    primarykey
    data
    text
    <p>I have a UITableView with UITableViewCells that contains a MKMapView.</p> <p>The Problem: if the table cell ever gets selected, then move the map, you see the mapview is all white and you only see the "Legal" label. </p> <p>Has anyone experienced this before?</p> <p><img src="https://i.stack.imgur.com/24ddw.png" alt="screenshot"></p> <p>Here is the entire code:</p> <pre><code>@implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.table.backgroundColor = [UIColor clearColor]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 5; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 70; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { MKMapView *map = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 220, 70)]; MKCoordinateSpan span = MKCoordinateSpanMake(0.01, 0.01); CLLocationCoordinate2D logCord = CLLocationCoordinate2DMake(47.606, -122.332); MKCoordinateRegion region = MKCoordinateRegionMake(logCord, span); [map setRegion:region animated:NO]; UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"aaaa"]; [cell.contentView addSubview:map]; return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload