I need set the align of a webview
in the bottom of a AbsoluteLayout
using java code
, no the xml layout.
I tried some Layoutparams combinations, but they didnt work:
AbsoluteLayout al = (AbsoluteLayout) act.findViewById(R.id.ad);
WebView wv = new WebView(act);
wv.setScrollContainer(false);
wv.getSettings().setJavaScriptEnabled(true);
wv.setBackgroundColor(Color.TRANSPARENT);
String html = "<html><body style='margin:0;padding:0;'><script type='text/javascript' src='http://ad.leadboltads.net/show_app_ad.js?section_id=" + bannerId + "'></script></body></html>";
wv.loadData(html, "text/html", "utf-8");
al.addView(wv);
I cant edit the xml layout
, I have to make this in code. I dont know if the problem is that AbsoluteLayout is deprecated? Or I have to set the webview in bottom instead the align the absolutelayout.
The situation is this, I have a Absolutelayout that fill the screen, and I want set the webview fill the width (this working by default now) and aligns in bottom (by default aligns in top)
The xml over I want to work is this: (I cant modify it)
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/${YYAndroidPackageName}"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<${YYAndroidPackageName}.DemoGLSurfaceView
android:id="@+id/demogl"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<AbsoluteLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:id="@+id/ad" >
</AbsoluteLayout>
</FrameLayout>
Sorry my english, thanks for the help.