iOS development-------plug a tablevirew into the callout

Source: Internet
Author: User

The default callout only a title and Detailtextlabel, the amount of information displayed is too small, although a small box on the map to display a little key information is very reasonable, but some customers need box to become larger, more information one there is no way.

Effect:

The way I take it is to plug a tableview directly into it, but TableView can't just plug it into the calliout, but you can plug a view into the callout, and the way I use it is to add tableview to a view, Then in the callout, on the code:

Self.mapView.callout.accessoryButtonHidden = YES;
Self.mapview.callout.accessorybuttontype=uibuttontypecustom;
Self.mapview.callout.color=[uicolor Whitecolor];
Self.mapview.callout.customview=nil;
Uiview*view=[uiview new];
View.frame=cgrectmake (0, 0, 170, 170);
View.backgroundcolor=[uicolor Redcolor];
[Self.xtbtableview Removefromsuperview];
Self.mapview.callout.customview=view;
Self.xtbtableview=nil;
Self.xtbtableview=[uitableview new];
Self.xtbtableview.frame=view.frame;
[Self.xtbtableview Setbackgroundcolor:[uicolor Yellowcolor];
self.xtbtableview.datasource=self;
Self.xtbTableView.delegate =self;
[Self.xtbtableview Reloaddata];
[View AddSubview:self.xtbTableView];
Self.mapview.callout.customview=view;
CGRect rect= Self.mapView.callout.customView.frame;
[Self.mapView.callout.customView Setframe:rect];
[Self.mapView.callout showcalloutat:xtbpoint Screenoffset:cgpointzero Animated:no];
self.mapview.touchdelegate=self;

iOS development-------plug a tablevirew into the callout

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.