我在 Android 设备上遇到了一个非常奇怪的问题,其中列表视图中的数据仅在我触摸屏幕时才显示。我正在使用jQM 1.2
,Phonegap 2.1
和. 下面是代码:Eclipse juno 4.2.1
Samsung Galaxy Note
<div data-role="page" id="sent_receipt" data-title="Sent Receipt" data-dom-cache="true">
<div data-role="header" class="header" data-position="fixed" data-tap-toggle="false">
<a id="a_sent_receipt" href="#search_receipt_option" data-icon="arrow-l" class="ui-btn-left" data-iconpos="notext" data-theme="d" data-direction="reverse"></a>
<h2>Sent Receipt</h2>
<a id="refresh" href="#" data-icon="refresh" class="ui-btn-right" data-iconpos="notext" data-theme="d"></a>
</div><!-- /header -->
<div data-role="content" data-iscroll>
<ul data-role="listview" id="ul_no_record">
</ul>
<ul data-role="listview" id="ul_sent_receipt_list_today">
</ul>
<ul data-role="listview" id="ul_sent_receipt_list_yesterday">
</ul>
<ul data-role="listview" id="ul_sent_receipt_list_this_week">
</ul>
<ul data-role="listview" id="ul_sent_receipt_list_last_week">
</ul>
</div><!-- /content -->
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
</div><!-- /footer -->
</div><!-- /page -->
$.ajax({
type: 'POST',
url: myApp.getHost() + myApp.getReceiptsUrl(),
cache: false,
data: {'email':myApp.getStoreValue('email')},
dataType: 'json',
timeout: myApp.getRequestTimeout(),
beforeSend: function(x) {
if (x && x.overrideMimeType) {
x.overrideMimeType('application/json;charset=UTF-8');
}
},
success: function(res) {
if(res.end === undefined) {
// some populated data goes here
ul.append('<li id="li_show_more" data-icon="false"></li>').listview('refresh').css('display','block');
} else {
ul.listview('refresh').css('display','block');
}
},
error: function(jqXHR, exception) {
},
complete: function(res) {
}