自Xcode 9问世以来,模拟器规模受到干扰.在某些模拟器上没有任何选项可以进一步扩展到100%,有时我根本无法切换到100%的比例.
在网上搜索后,我发现有时如果缩放不起作用,我需要做以下操作以使其100%缩放.
- 取消选中Window - > Show Device Bezels
- 单击窗口 - >缩放
- 检查窗口 - >显示设备挡板
如果我想要或当前Xcode根本不支持进一步扩展,那么我是否缺少进一步扩展它.
我已经设定
self.tableView.estimatedRowHeight = 88.0
self.tableView.rowHeight = UITableViewAutomaticDimension
Run Code Online (Sandbox Code Playgroud)
此外,我已将numberOfLines UILabel设为零.我没有在IB中给出任何固定的高度/宽度约束.仍然我的UITableviewCell高度没有相应扩展.
请建议我做什么.
我在故事板中将一个 tableView 拖到我的控制器上。我将类型设置为分组,但我不知道是否可以在storyboard中设置tableView的节号。
我无法在静态单元格中看到 tableview 的内容。如果我这样做,它会报告错误。
我想知道如何annotation在拖动标题时更新我的标题,因为所有annotation属性都是get唯一的。
我尝试过的代码:
func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationViewDragState, fromOldState oldState: MKAnnotationViewDragState) {
switch (newState) {
case .starting:
//view.dragState = .dragging
print("dragging.....")
case .ending, .canceling:
// view.dragState = .none
let lat = view.annotation?.coordinate.latitude
let long = view.annotation?.coordinate.longitude
let coordinates = CLLocationCoordinate2D(latitude: lat!, longitude: long!)
print(" pin lat \(lat) long \(long)")
//Error here - title is get only property
view.annotation?.title = "New Location"
default: break
}
}
Run Code Online (Sandbox Code Playgroud) 我想显示两个坐标之间的地图。我已使用此代码来显示包含两个坐标的地图矩形。但我的两个坐标都没有显示,而是显示了两个坐标之间的区域(不包括坐标)。我应该怎么做才能包含我的两个坐标?
let coordinate1 = CLLocationCoordinate2DMake(28.53, 77.39)
let coordinate2 = CLLocationCoordinate2DMake(29.13,76.69)
// convert them to MKMapPoint
let p1 = MKMapPointForCoordinate (coordinate2);
let p2 = MKMapPointForCoordinate (coordinate1);
let mapRect = MKMapRectMake(fmin(p1.x,p2.x), fmin(p1.y,p2.y), fabs(p1.x-p2.x), fabs(p1.y-p2.y));
mapView.setVisibleMapRect(mapRect, animated: true)
Run Code Online (Sandbox Code Playgroud) 我有UICollectionView两个部分。首先,它具有UIPageControl,其次是simple UICollectionView。在第一个元素和第二个元素之间有间距,您能建议我如何删除它吗?
平台iOS 9。*,Swift 3
ios ×5
swift ×3
mapkit ×2
uitableview ×2
coordinates ×1
ios11 ×1
storyboard ×1
swift2 ×1
swift3 ×1
uistoryboard ×1
xcode9 ×1