Tag: 可视化

UITableViewCell和heightForRowAtIndexPath的iOSdynamic高度

我在一个大项目中使用Autolayout来处理新的UITableViewCells。 我有一个TableView自动计算每一行的高度,那里我不使用委托函数heightForRowAtIndexPath 。 我已经宣布了估计的行高: tableView.estimatedRowHeight = 44.0 tableView.rowHeight = UITableViewAutomaticDimension 我的问题是:在另一个TableViewController有很多的UITableViewCells,我在编程上需要声明heightForRowAtIndexPath单元格的高度。 我知道这将是更好的转换所有单元格使用独特的解决scheme,但在这个项目中有很多不同的单元格,所以我想使用一个解决方法,并结合dynamic计算的高度与自动布局和编程计算的行高度。 这可能吗?

在添加新行后,UITableView scrollToRow不再适用于iOS 11

我注意到一个奇怪的UITableView行为,似乎只发生在iOS 11设备上。 插入一个新行(改变数据源,然后调用reloadData)之后,在调用scrollToRow或scrollToBottom()方法时, UITableView将不会滚动到该行。 当在iOS 10或更早版本上做一些事情时,它可以很好地工作,而UITable就像它应该的那样滚动。 谢谢!

奇怪的UITableView插入/删除行animation

在UITableView中使用animation(UITableViewRowAnimationTop)插入/删除UITableViewCell时,会看到一个奇怪的效果。 当要插入的单元比上面的单元格大得多时,会发生animation故障。 这个video显示了模拟器中的小故障,黄色单元突然出现在从顶部滑动的地方。 这是video中的Xcode项目。 贝娄是单元格插入/animation代码。 – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 2 + self.thirdCellVisible; } – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:NO]; if (indexPath.row == 1) { if (self.thirdCellVisible) { self.thirdCellVisible = !self.thirdCellVisible; [tableView deleteRowsAtIndexPaths:@[self.thirdCellIndexPath] withRowAnimation:UITableViewRowAnimationTop]; } else { self.thirdCellVisible = !self.thirdCellVisible; [tableView insertRowsAtIndexPaths:@[self.thirdCellIndexPath] withRowAnimation:UITableViewRowAnimationTop]; } } } – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath […]

有没有可能在UITableView中更改字体的types和大小?

我想更改UITableView字体types和大小。 例如,我将如何将它设置为Tahoma?

有像iOS的JUNG的可视化框架?

有像iOS的JUNG的可视化框架? 我想实现类似的东西。

带透明渐变的UITableView顶部和底部

我已经search了这个论坛,谷歌和其他论坛,并没有find我的特定问题的答案。 基本上,我有一个包含UITableView的UIView 。 我遵循这个教程 ,它是部分成功的。 问题是渐变。 我有一个背后的UITableView背景图像。 所以随着细胞接近渐变,我想要显示背景,而不是白色。 我也发现这篇文章是我在哪里find的教程,但我不想用Matt自己的问题来劫持那篇文章。 任何帮助正确的方向将是伟大的! 编辑1:我知道我可以使用另一个图像的背景图像和中间切出,但我正在寻找AVOIDS使用PNG的解决scheme,如果可能的话。 编辑2:这是我现在得到的图像: EDIT3: 这是我的代码: 标题: @interface MyView : UIViewController { CAGradientLayer *_maskLayer; UITableView *_tableView; } @property (nonatomic, retain) CAGradientLayer *maskLayer; @property (nonatomic, retain) IBOutlet UITableView *tableView; 执行: @implementation HighScoresView_iPhone @synthesize tableView = _tableView; @synthesize maskLayer = _maskLayer; – (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (![self maskLayer]) […]

为什么使用“viewWithTag”和“dequeueReusableCellWithIdentifier”?

有人可以请解释为什么你应该使用viewWithTag从dequeueReusableCellWithIdentifier的单元格获取子视图(如UILabel等)? 一些背景信息:我有一个自定义的UITableViewCell与几个UILabel在它(我已经转载了下面这个简单的版本)。 这些标签在关联的NIB文件中定义,并用IBOutlet声明并链接回自定义单元的控制器类。 在tableview的dequeueReusableCellWithIdentifier ,我这样做: CustomCell *customCell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:@"CustomCellId"]; if (customCell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"customCell" owner:self options:nil]; for (id oneObject in nib) if ([oneObject isKindOfClass:[CustomCell class]]) customCell = (CustomCell *)oneObject; } customCell.firstLabel.text = @"Hello"; customCell.secondLabel.text = @"World!"; return customCell; 一切工作正常。 然而从我看到的教程,它看起来像改变标签的价值观,我应该这样做,而不是: UILabel *firstLabel = (UILabel *)[customCell.contentView viewWithTag:555]; firstLabel.text […]

什么是一个好的iOS数据可视化库?

类似于现有的问题什么是创build状态图和animation的好的可视化库 。 我正在寻找类似于在iOS上工作的Flare Prefuse的库。 你会推荐什么?

如何更改uitableview删除button的文字

您好那里我试图改变显示在删除button时,用户在我的tableview中的一个uitableviewcell滑动的文本。 我在另一个问题线程中看到了一个例子,说使用这个tableview委托 – (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath 我的问题是,我如何使用这种方法..我不知道如何使用这个。

Xcode 8.2.1 / Swift 3 – 从Plist字典数组中加载Ta​​bleView

我有一个plist,我复制到我的项目在TableView中使用它。 plist加载并通过打印内容和行数到控制台进行validation。 当我构build项目时,我得到一个空白的TableView,但没有数据。 我search了几天,但仍然无法显示。 这是我的代码: import UIKit class TableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() let filePath = Bundle.main.path(forResource: "directory", ofType: "plist") let employees = NSArray(contentsOfFile: filePath!) as! [[String: String]] func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return (employees.count) } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let […]