【发布时间】:2014-08-24 11:52:23
【问题描述】:
我在 webview 中显示一个 .gif。有用!。但它显示在左侧。我需要显示在中心。
View footerView = ((LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.listviewfooter, null, false);
webviewLoadmore = (WebView) footerView.findViewById(R.id.webviewLoadmore);
webviewLoadmore.loadUrl("file:///android_asset/load_icon.gif");
之后我将它添加到 Listview 页脚中。
clubListView.addFooterView(webviewLoadmore);
我的 xml 布局
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webviewLoadmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scrollbars="none"
android:scaleType="centerInside"
>
</WebView>
【问题讨论】:
-
试试 android:gravity="center"
-
这不是 webview 的属性
-
哦,对不起,我的意思是布局