我有一个UITableView填充了可变高度的单元格.当视图被推入视图时,我希望表格滚动到底部.
我目前有以下功能
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[log count]-1 inSection:0];
[self.table scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];
Run Code Online (Sandbox Code Playgroud)
log是一个可变数组,包含构成每个单元格内容的对象.
上面的代码工作正常viewDidAppear但是这有一个不幸的副作用,当视图首次出现然后跳到底部时显示表的顶部.如果table view可以在它出现之前滚动到底部我更喜欢它.
我试图滚动中viewWillAppear和viewDidLoad,但在数据尚未加载到表并且都抛出一个异常,这两种情况.
任何指导都会非常感激,即使只是告诉我我所拥有的一切都是可能的.
我正在使用.NET 3.5 MSChart控件,有时我发现我需要向Series或DataPoints添加自定义属性.
例如:
Series series = new Series();
series["PieDrawingStyle"] = "SoftEdge";
DataPoint point = new DataPoint();
point["Exploded"] = "true"
point["PieLabelStyle"] = "Disabled";
Run Code Online (Sandbox Code Playgroud)
我使用的所有自定义属性都是从Microsoft提供的Web Samples项目中找到的,有时是从示例中给出的源,有时通过打开项目并手动查找源.
我的问题是,我可以在任何地方查看所有可用自定义属性的完整列表以供参考吗?
请考虑以下代码
NSString *param_string @"1:3:6:10:15:22:28:30";
NSArray *params = [param_string componentsSeparatedByString:@":"];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterNoStyle];
NSMutableArray *convertedArray = [[NSMutableArray alloc] initWithCapacity:[params count]];
for(int i = 0; i < [params count]; i++){
[convertedArray insertObject:[formatter numberFromString:[params objectAtIndex:i] atIndex:i]];
}
Run Code Online (Sandbox Code Playgroud)
有没有更好,更有效的方法来实现这一目标?最初的param_string在实践中可能会更长,但我不希望params数组中有超过200个元素.
谢谢