小编Avn*_*aur的帖子

如何使用动态单元格高度和自动布局以编程方式创建非常基本的UITableView?

请注意:我知道在类似的行上有很多例子.我正在寻找最基本的解决方案,只需要最少的设置.

我试图自己创造一个,我知道我离开了..

    #import "ViewController.h"

    @interface ViewController () <UITableViewDataSource, UITableViewDelegate>

    @property(strong, nonatomic) UITableView *tableView;
    @property(strong, nonatomic) NSMutableArray *dataArray;
    @property (strong, nonatomic) UITableViewCell *customCell;

    @end

    @implementation ViewController

    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
        self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];
        [self.tableView setDataSource:self];
        [self.tableView setDelegate:self];
        [self.tableView setShowsVerticalScrollIndicator:NO];
        self.tableView.translatesAutoresizingMaskIntoConstraints = NO;
        self.tableView.rowHeight = UITableViewAutomaticDimension;
        [self.view addSubview:self.tableView];

        self.dataArray = [@[@"For the past 33 years, I have looked in the mirror every …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c ios autolayout

8
推荐指数
1
解决办法
2万
查看次数

谷歌地图在iOS中闪烁

我在我的应用程序中通过pod使用Google Maps SDK for iOS版本:1.10.17867.0.但是当我在特定位置初始化地图时,所有标题和地图都会开始闪烁.示例代码(swift):

import UIKit
import GoogleMaps

class ViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    self.view.backgroundColor = UIColor.whiteColor();
    var camera = GMSCameraPosition.cameraWithLatitude(19.0176147, longitude: 72.8561644, zoom:18) 
    // even try this: 28.6469655, longitude: 77.0932634, zoom:10 
    var mapView = GMSMapView.mapWithFrame(CGRectZero, camera:camera)

    var marker = GMSMarker()
    marker.position = camera.target
    marker.snippet = "Hello World"
    marker.appearAnimation = kGMSMarkerAnimationPop
    marker.map = mapView

    self.view = mapView
  }
}
Run Code Online (Sandbox Code Playgroud)

google-maps ios cocoapods google-maps-sdk-ios swift

5
推荐指数
1
解决办法
1686
查看次数