我使用MkMapView与谷歌地图.我成功显示地图视图和地址与注释pin.But我想要增加缩放级别.如何以编程方式设置它????
-(void)showMyAddress
{
//Hide the keypad
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta=0.2;
span.longitudeDelta=0.2;
CLLocationCoordinate2D location = [self addressLocation];
region.span=span;
region.center=location;
if(addAnnotation != nil) {
[mapView removeAnnotation:addAnnotation];
[addAnnotation release];
addAnnotation = nil;
}
addAnnotation = [[AddAnnotation alloc] initWithCoordinate:location ];
[addAnnotation setMTitle:@"abc"];
[addAnnotation setMSubTitle:@"def."]
[mapView addAnnotation:addAnnotation];
[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
}
-(CLLocationCoordinate2D) addressLocation {
NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv",
[@"abc" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString] encoding:NSStringEncodingConversionAllowLossy error:nil];
NSArray *listItems = [locationString componentsSeparatedByString:@","];
double latitude = 0.0;
double longitude = 0.0; …Run Code Online (Sandbox Code Playgroud) 当我输入/login网址时,它会出错
例如:
from flask import Flask ,url_for,render_template,request
app = Flask(__name__)
@app.route('/login')
def index():
return "index"
if __name__== "__main__":
app.run()
Run Code Online (Sandbox Code Playgroud)
错误结果是这样的:
Not Found.
The requested URL was not found on the server.
Run Code Online (Sandbox Code Playgroud)
当我/login用/login/或替换任何其他单词时/log,它会没事的.这是怎么发生的?
我正在设置多个UNUsernotnotifications,如下所示,
- (void)viewDidLoad {
[super viewDidLoad];
notifCount = 0;
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
[center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert)
completionHandler:^(BOOL granted, NSError * _Nullable error) {
if (!error) {
NSLog(@"request succeeded!");
[self set10Notif];
}
}];
}
Run Code Online (Sandbox Code Playgroud)
在该set10Notif方法中,我设置多个(8个用于测试)通知,时间与当前时间相差10秒.
-(void) set10Notif
{
notifCount = notifCount+1;
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0") && notifCount < 10)
{
// create actions
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
[calendar setTimeZone:[NSTimeZone localTimeZone]];
NSDate *fireD = [[NSDate date] dateByAddingTimeInterval:notifCount*10];
NSString *fireStr = [self returnStringFromDate:fireD withFormat:@"hh/mm/ss dd/MM/yyyy"];
NSDateComponents *components …Run Code Online (Sandbox Code Playgroud) objective-c ios ios10 usernotifications unusernotificationcenter
所以基本上我正在为Android制作日历应用程序.我想知道当用户输入用户名和密码到Android应用程序时,简单地从Google日历(在线)检索所有事件的过程.我的应用程序是否可以从Google日历中获取所有事件并将其存储在ArrayList或其他结构中?如果是这样,那么你可以链接/给我一个例子.我似乎无法找到任何解决方案.
我还在学习JSON,并使用SBJSON.我将如何获取NSDictionary并将其转换为类似于此的JSON对象:
{"id":"123","list":"456","done":1,"done_date":1305016383}
Run Code Online (Sandbox Code Playgroud) 嗨我通过iTunes安装应用程序,但是当我将应用程序(.ipa文件)添加到iTunes时,它不显示应用程序图标图像,当我将应用程序安装到iPhone时,它显示应用程序图标图像.
我可以知道问题出在哪里.
我想将.ipa文件添加到iTunes时显示图像.
我正在使用最新的 SDK 开发 iOS 应用程序。
我从我做的一个 Android 应用程序中获得了这个资源:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gauge_background">
<gradient
android:startColor="#449def"
android:endColor="#2f6699"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners android:radius="30dp" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
</shape>
Run Code Online (Sandbox Code Playgroud)
并想在我的 iOS 应用程序中使用它。
你知道有没有办法加载这个xml并将其显示为UIView backgroundColor?
像这样的东西:
self.backgroundColor =
[[UIColor alloc] initWithPatternImage:[UIImage imageNamed:imageName]];
Run Code Online (Sandbox Code Playgroud) 我想分开一条路可以有人帮助我吗?
我的意见是:
$getpath = "/u/project/path/file.name";
Run Code Online (Sandbox Code Playgroud)
我想分成/u/project/path一个变量和file.name其他变量.
我正在尝试将Google Analytics添加到我的iOS应用中.我已经将所有正确的框架添加到Xcode中.我按照SDK v3启动指南进行了操作.但是当我补充说:
self.trackedViewName = @"About Screen";
Run Code Online (Sandbox Code Playgroud)
对我来说viewcontroller,我说错了
trackedViewName在类型的对象上找不到属性ViewController
在我的.h文件中,我导入GAITrackedViewController.h并添加GAITrackedViewController到界面中.
您认为问题可能是什么?
我创建了一个UIPopoverController并将其添加到视图控制器时单击UIButton如下所示
- (void)viewDidLoad
{
[super viewDidLoad];
controller = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
popoverController = [[UIPopoverController alloc] initWithContentViewController:controller];
}
- (IBAction)showPopover:(UIButton *)sender
{
if ([popoverController isPopoverVisible]) {
[popoverController dismissPopoverAnimated:YES];
} else {
CGRect popRect = CGRectMake(self.btnShowPopover.frame.origin.x,
self.btnShowPopover.frame.origin.y,
self.btnShowPopover.frame.size.width,
self.btnShowPopover.frame.size.height);
[popoverController presentPopoverFromRect:popRect
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
}
}
Run Code Online (Sandbox Code Playgroud)
btnShowPopover是UIButton在viewcontroller,popoverController是UIPopoverController.
的popovercontroller同时单击该按钮显示正常.
但它不会解雇当我点击UIButton的secondviewcontroller
我使用了以下代码
-(IBAction)y:(id)sender{
fs = [[Firstviewcontroller alloc] initWithNibName:@"FIrstscreen" bundle:[NSBundle mainBundle]];
[fs.popoverController dismissPopoverAnimated:TRUE];
}
Run Code Online (Sandbox Code Playgroud)
但它没有用. …