各位大虾好
最近在做一个类似于flash播放器的东西,可以实现通过webview加载flash成功,但是后来再addview的时候,添加的按钮或者图片会被flash给挡住了,我是使用的framelayout框架,有谁遇到过能帮帮忙?我的思路应该没问题<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_gravity="center"
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout android:layout_gravity="center"
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</FrameLayout>
添加按钮view的代码 public void createButtons()
{
Button btShuRus[] = new Button[2];
mFrameLayout = (FrameLayout)findViewById(R.id.frame);
FrameLayout.LayoutParams viewParam = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT); // 定义显示组件的参数
RelativeLayout.LayoutParams lpButton = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
for (int i = 0; i < btShuRus.length; i++) {
btShuRus[i] = new Button(this);
btShuRus[i].setText(String.valueOf(i)+" ok ");
}
mRelativeLayout1 = new RelativeLayout(this);//(RelativeLayout) findViewById(R.id.relativeLayout1);
mFrameLayout.addView(mRelativeLayout1, viewParam);
for (int i = 0; i < btShuRus.length; i++) {
mRelativeLayout1.addView(btShuRus[i], lpButton);
}
btShuRus[0].layout(50, 200, 50, 50);
btShuRus[1].layout(100, 300, 50, 50);
Log.i(tag, "createButtons");
mFrameLayout.bringChildToFront(mRelativeLayout1);
mRelativeLayout1.bringChildToFront(btShuRus[0]);
}
最近在做一个类似于flash播放器的东西,可以实现通过webview加载flash成功,但是后来再addview的时候,添加的按钮或者图片会被flash给挡住了,我是使用的framelayout框架,有谁遇到过能帮帮忙?我的思路应该没问题<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_gravity="center"
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout android:layout_gravity="center"
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</FrameLayout>
添加按钮view的代码 public void createButtons()
{
Button btShuRus[] = new Button[2];
mFrameLayout = (FrameLayout)findViewById(R.id.frame);
FrameLayout.LayoutParams viewParam = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT); // 定义显示组件的参数
RelativeLayout.LayoutParams lpButton = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
for (int i = 0; i < btShuRus.length; i++) {
btShuRus[i] = new Button(this);
btShuRus[i].setText(String.valueOf(i)+" ok ");
}
mRelativeLayout1 = new RelativeLayout(this);//(RelativeLayout) findViewById(R.id.relativeLayout1);
mFrameLayout.addView(mRelativeLayout1, viewParam);
for (int i = 0; i < btShuRus.length; i++) {
mRelativeLayout1.addView(btShuRus[i], lpButton);
}
btShuRus[0].layout(50, 200, 50, 50);
btShuRus[1].layout(100, 300, 50, 50);
Log.i(tag, "createButtons");
mFrameLayout.bringChildToFront(mRelativeLayout1);
mRelativeLayout1.bringChildToFront(btShuRus[0]);
}
使用webview加载完flash之后,所有的元素都会被flash覆盖
这时只要写一个延时,1s后弹出popupwindow,就可以实现类似于多图层的问题,然后针对popupwindow做相应的操作。谁来留个言,把分给了!
使用webview加载完flash之后,所有的元素都会被flash覆盖
这时只要写一个延时,1s后弹出popupwindow,就可以实现类似于多图层的问题,然后针对popupwindow做相应的操作。