我UICollectionView
用这样的image
模式设置了a的颜色:
self.collectionView.backgroundColor = [UIColor colorWithPatternImage:image];
Run Code Online (Sandbox Code Playgroud)
我想设置alpha的alpha collectionView
而不影响alpha的alpha UICollectionViewCell
.有没有办法做到这一点?设置alpha collectionView
也会影响UICollectionViewCell
,所以我已经尝试过了.我还应该尝试什么/其他什么才能真正起作用?
谢谢你的任何提示.
我正在使用此代码获取当前位置但未获得正确的结果以获取模拟器中的当前位置,
-(void)initLocationManager
{
locationManager=[[CLLocationManager alloc] init];
locationManager.delegate = self;
if (([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]))
{
[locationManager requestWhenInUseAuthorization];
}
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = kCLDistanceFilterNone;
//[locationManager requestWhenInUseAuthorization];
// [locationManager startMonitoringSignificantLocationChanges];
[locationManager startUpdatingLocation];
}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
CLLocation* location = [locations lastObject];
// NSDate* eventDate = location.timestamp;
// NSTimeInterval howRecent = [eventDate timeIntervalSinceNow];
latitud = location.coordinate.latitude;
longitud = location.coordinate.longitude;
NSLog(@"%f,%f",latitud,longitud);
[locationManager stopUpdatingLocation];
}
Run Code Online (Sandbox Code Playgroud)
请告诉我如何获取当前位置,我从早上开始厌倦了.请帮我
在我的项目中,我将借助纬度和经度找出两个位置之间的路径.
我正在使用以下代码
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[mapvw setDelegate:self];
[self mapp];
}
-(void)mapp
{
CLLocationCoordinate2D coordinateArray[2];
coordinateArray[0] = CLLocationCoordinate2DMake(28.6129, 77.2295);
coordinateArray[1] = CLLocationCoordinate2DMake(28.6562, 77.2410);
self.routeLine = [MKPolyline polylineWithCoordinates:coordinateArray count:2];
[mapvw setVisibleMapRect:[self.routeLine boundingMapRect]]; //If you want the route to be visible
[mapvw addOverlay:self.routeLine];
}
-(MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay
{
if(overlay == self.routeLine)
{
if(nil == self.routeLineView)
{
self.routeLineView = [[MKPolylineView alloc] initWithPolyline:self.routeLine];
self.routeLineView.fillColor = [UIColor redColor];
self.routeLineView.strokeColor = …
Run Code Online (Sandbox Code Playgroud)