如果此布局中的 WebView 为100%,如何绘制包含 WebView 的布局(行)装?我想处理滚动加载,但是当我的 WebView wrap_content 时,它在启动时无法正常工作属性还没有加载。我尝试为 WebView 应用 min_height ,或者将 WebView < strong> LinearView , min_height ,但效果不佳。
我的loadData()函数:
public void loadData() {
viewOrders = new Runnable(){
@Override
public void run() {
getOrders();
}
};
Thread thread = new Thread(null, viewOrders, "MagentoBackground");
thread.start();
m_ProgressDialog = ProgressDialog.show(MainActivity.this,
"Please wait...", "Retrieving data ...", true);
}
我的getView()函数:
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.row, null);
}
Order o = items.get(position);
if (o != null) {
TextView name = (TextView) v.findViewById(R.id.row_textView);
WebView web_view = (WebView) v.findViewById(R.id.row_webView);
if (name != null) {
name.setText("Name: "+o.getOrderName()); }
if(web_view != null){
//web_view.setText(o.getOrderLink());
web_view.loadUrl(o.getOrderLink());
web_view.getSettings().setUseWideViewPort(true);
web_view.getSettings().setLoadWithOverviewMode(true);
web_view.setInitialScale(30);
}
}
return v;
}