当前位置: 编程技术>移动开发
本页文章导读:
▪tabbarItem 讯息提示 tabbarItem 消息提示
tabbarItem 消息提示 self.tabBarItem.badgeValue=@"100";
......
▪ UITabBarController 单击 又点击 双击 UITabBarController 单击 再点击 双击
UITabBarController
//当选中项改变的时候会触发
- (void)tabBarController:(UITabBarController*)tabBarController didSelectViewController:(UIViewController*)viewController {
NSLog(@"disSelect");.........
▪ 透过google api获得位置的方向 通过google api获得位置的方向
private String[] getDirectionData(String sourceLat, String sourceLong,
String destinationLat, String destinationLong) {
String urlString = "http://maps.google.com/maps?f=d&hl=en&" + "saddr="
.........
[1]tabbarItem 讯息提示
来源: 互联网 发布时间: 2014-02-18
tabbarItem 消息提示
tabbarItem 消息提示 self.tabBarItem.badgeValue=@"100";
tabbarItem 消息提示 self.tabBarItem.badgeValue=@"100";
[2] UITabBarController 单击 又点击 双击
来源: 互联网 发布时间: 2014-02-18
UITabBarController 单击 再点击 双击
UITabBarController
//当选中项改变的时候会触发
- (void)tabBarController:(UITabBarController*)tabBarController didSelectViewController:(UIViewController*)viewController {
NSLog(@"disSelect");
//使每次点击tab都回到跟目录
// if ([viewController isKindOfClass:[UINavigationController class]]) {
// [(UINavigationController*)viewController popToRootViewControllerAnimated:YES];
// }
}
//每次点击当前tab的时候会触发
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)vc {
NSLog(@"shouldSelect");
//当前选中的tab
UIViewController *selectTab = tabBarController.selectedViewController;
//vc: 将要选中的tab
//判断是不是选择了自己
if ([selectTab isEqual:vc]) { }
}
[3] 透过google api获得位置的方向
来源: 互联网 发布时间: 2014-02-18
通过google api获得位置的方向
private String[] getDirectionData(String sourceLat, String sourceLong,
String destinationLat, String destinationLong) {
String urlString = "http://maps.google.com/maps?f=d&hl=en&" + "saddr="
+ sourceLat + "," + sourceLong + "&daddr=" + destinationLat
+ "," + destinationLong + "&ie=UTF8&0&om=0&output=kml";
Log.d("URL", urlString);
Document doc = null;
HttpURLConnection urlConnection = null;
URL url = null;
String pathConent = "";
try {
url = new URL(urlString.toString());
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
urlConnection.connect();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(urlConnection.getInputStream());
} catch (Exception e) {
}
NodeList nl = doc.getElementsByTagName("LineString");
for (int s = 0; s < nl.getLength(); s++) {
Node rootNode = nl.item(s);
NodeList configItems = rootNode.getChildNodes();
for (int x = 0; x < configItems.getLength(); x++) {
Node lineStringNode = configItems.item(x);
NodeList path = lineStringNode.getChildNodes();
pathConent = path.item(0).getNodeValue();
}
}
String[] tempContent = pathConent.split(" ");
return tempContent;
}
最新技术文章: