<% item.question_options.sort.each do |opt| %>
<%= radio_button_tag('responder[selected_options][' + item.id.to_s + '][][option_id]', opt.id.to_s, @responder.answered_to?(opt, item))%>
<%= text_field_tag('responder[selected_options][' + item.id.to_s + '][][content]', @responder.get_response_for_option(item, opt, lang.id)%>
<% end %>
我制作了一个ViewController并在其中添加了一个表视图。一些数据填充在单元格中,然后显示。 当我运行它时,最初我没有在我的单元格中看到任何数据。但是当滚动表视图时,单元格开始显示实际数据。我不明白可能是什么原因。请指点???
我想动态调整单元格的大小,因为数据可以是随机大小。滚动一次后,数据才会显示。
答案 0 :(得分:0)
在setupTable
中,选中sectionArray
和orderedData
以确保它们不为空。在setupTable
中添加断言,例如
sectionArray = [[SummaryModel sharedInstance] getTableSections:self.s_sendEnhancementServerDict];
orderedData = [[SummaryModel sharedInstance] getOrderedData:self.s_sendEnhancementServerDict];
NSAssert([sectionArray count] && [orderedData count], @"No data!"); // add this line
[self.bookingsTableView reloadData];
答案 1 :(得分:0)
此问题与使用UITableViewAutomaticDimension有关,并且已在其他地方报告过。所以这行代码解决了我的问题:
-(void)viewDidAppear:(BOOL)animated {
[self.tableView reloadData];
}
这只是在显示之前重新加载所有表格部分和行。因此用户不会遇到空白行。请参阅:http://www.appcoda.com/self-sizing-cells/
答案 2 :(得分:0)
你在主线程(viewdidload)中使用重载数据你只需要使用 像下面的代码一样调度异步:
webview.Settings.JavaScriptEnabled = true;
webview.Settings.DomStorageEnabled = true;//This does not make any difference
}
答案 3 :(得分:0)
迅速5+ iOS 13 Xcode 11.2.1以上 惊人的答案
#no errors
df = {"id": [12,16,12,16,13,16,14], "ft1": [1,4,1,3,6,7,2], "ft2": [2,3,5,1,6,3,1]}
#error
df = {"id": [012,016,012,016,013,016,014], "ft1": [1,4,1,3,6,7,2], "ft2": [2,3,5,1,6,3,1]}
File "<ipython-input-120-ab3f36e5a552>", line 1
df = {"id": [012,016,012,016,013,016,014], "ft1": [1,4,1,3,6,7,2], "ft2": [2,3,5,1,6,3,1]}
^
SyntaxError: invalid token