我正在开发一个可以使用 iframe 在 webview 中播放 youtube 视频的应用程序。 我的代码如下:
String summary = "<iframe height='"
+ displayWidth
+ "' width='"
+ 800
+ "' frameborder='0' src='http://www.youtube.com/embed/ZfekaIW6esA?rel=0'></iframe>";
if (flashInstalled) {
mWebView.loadData(summary, "text/html", null);
container.addView(mWebView);
} else {
alert.setMessage("Flash player is not installed on the device!");
alert.show();
}
它工作正常,但是当我缩放它并滚动它时,它会与其他布局重叠 看我的截图
请给我更好的解决方案。谢谢
最佳答案
我认为您的 Iframe 宽度和高度大于 Webview 宽度和高度。减小 Iframe 的大小。如果您想要更大的尺寸,请增加 webview 的尺寸。
<RelativeLayout
android:id="@+id/titlebarlayout"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:background="@drawable/titlebar2" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@drawable/searchmap" >
</Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:background="@drawable/searchmap" >
</Button>
</RelativeLayout>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/titlebarlayout" >
<RelativeLayout
android:id="@+id/webviewlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<android.webkit.WebView
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="280dp" >
</android.webkit.WebView>
<TextView
android:id="@+id/textview1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/webView1"
android:text="Chasing a target of 237 to record their third win on the trot, India needed nine runs off the last over bowled by Lasith Malinga, but Sri Lanka missed the chance to dismiss Dhoni in the fourth ball of the over when the bowler fluffed a simple run out chance; and the skipper then took three runs off the last delivery to leave Sri Lanka still searching for their first win in the tournament. There was some drama even after the last delivery as the umpires checked if the batsmen had ran one short, but replays showed they hadn't and the match ended in a tie. As an aside, Malinga had a five ball over in India's 30th over of the innings, and it is anyone's guess if the result would have been different had the error been spotted.
India stuck to the rotational policy with Sachin Tendulkar coming in for Virender Sehwag, who had a back spasm; while Irfan Pathan made another comeback as he replaced Zaheer Khan, who had a problem with his right calf. Tendulkar hit two boundaries in his 24-ball 15, but never looked comfortable in the middle, and he was the first Indian batsman to be dismissed when he edged an angled delivery around the off stump from Nuwan Kulasekara to Kumar Sangakkara behind the stumps. Tendulkar's failure is bound to be blamed on the rotational policy by its detractors, who feel the rhythm of the batsmen is disrupted.
" >
</TextView>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
关于android - 当我们滚动时,youtube 视频播放器与其他布局重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9307147/
是否可以为特定(或所有)项目使用多个布局?例如,我有几个项目,我想对其应用两种不同的布局。一个是绿色的,一个是蓝色的(但是)。我想将它们编译到我的输出目录中的两个不同文件夹中(例如v1和v2)。我一直在玩弄规则和编译block,但我不知道这是怎么回事。因为,每个项目在编译过程中只编译一次,我不能告诉nanoc第一次用layout1编译,第二次用layout2编译。我试过这样的东西,但它导致输出文件损坏。compile'*'doifitem.binary?#don’tfilterbinaryitemselsefilter:erblayout'layout1'layout'layout2'
最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路
目前我正在使用这个正则表达式从YoutubeURL中提取视频ID:url.match(/v=([^&]*)/)[1]我怎样才能改变它,以便它也可以从这个没有v参数的YoutubeURL获取视频ID:http://www.youtube.com/user/SHAYTARDS#p/u/9/Xc81AajGUMU感谢阅读。编辑:我正在使用ruby1.8.7 最佳答案 对于Ruby1.8.7,这就可以了。url_1='http://www.youtube.com/watch?v=8WVTOUh53QY&feature=feedf'url
我一直在寻找一种以编程方式或通过命令行将mp3转换为aac的方法,但没有成功。理想情况下,我有一段代码可以从我的Rails应用程序中调用,将mp3转换为aac。我安装了ffmpeg和libfaac,并能够使用以下命令创建aac文件:ffmpeg-itest.mp3-acodeclibfaac-ab163840dest.aac当我将输出文件的名称更改为dest.m4a时,它无法在iTunes中播放。谢谢! 最佳答案 FFmpeg提供AAC编码功能(如果您已编译它们)。如果您使用的是Windows,则可以从here获取完整的二进制文件。
例如,如果我们defc=(foo)p"hello"endc=3c=(3)并且不会打印“hello”。我知道它可以被self.c=3调用,但为什么呢?可以通过哪些其他方式调用它? 最佳答案 c=3(和c=(3),完全等同于它)总是被解释为局部变量赋值。你可能会说只有当方法c=没有在self上定义时,它才应该被解释为局部变量赋值,但是这有很多问题:至少MRI需要在解析时知道在给定范围内定义了哪些局部变量。但是,在解析时并不知道给定的方法是否已定义。所以ruby直到运行时才知道c=3是否定义了变量c或者调用了方法c=,这意味着它不会知
我如何用ruby编写一个脚本,当从命令行执行时播放mp3文件(背景音乐)?我试过了run="mplayer#{"/Users/bhushan/resume/m.mp3"}-aosdl-vox11-framedrop-cache16384-cache-min20/100"system(run)但它也不起作用,以上是播放器特定的。如果用户没有安装mplayer怎么办。有没有更好的办法? 最佳答案 我一般都是这样pid=fork{exec'mpg123','-q',file} 关于ruby
我试图定义一个带有方法的类,以及一个缺少这些方法的类,然后允许后一个类的对象从前一个类的实例“学习”这些方法。这是我的尝试(Ruby1.9.2)-当我尝试更改lambda绑定(bind)中“self”的值时,它中断了(在注释为“BREAKS!”的行处)。如果您能想出如何解决这个问题-我很想知道。classSkillattr_accessor:nameattr_accessor:techniquedefinitialize(name,&technique_proc)@name=name@technique=lambda(&proc)endendclassPersonattr_access
这个问题说明了一切。例如,我有一台安装了ruby1.8.6的服务器。当我尝试sudogeminstallroo时,它给出了错误nokogirirequiresRubyversion>=1.8.7。所以,我想安装与Ruby1.8.6兼容的旧版本roo。但我不知道去哪里搜索。我知道RubyForge,但它也没有说明Ruby的兼容版本。 最佳答案 蛮力方法是获取一个git克隆,搜索它指定的Ruby版本的位置,然后使用gitblame甚至gitpickaxe来确定最后一个没有的版本'没有那个要求。
我想为网站的管理和公共(public)部分设置一对样式指南。每个都需要自己的布局,其中包含静态html和调用erbpartials的混合(因此静态页面不会削减它)。我不需要Controller来为这些页面提供服务,而且我不希望有效的仅开发内容使其余代码困惑。这让我想知道是否有一种方法可以直接呈现布局。免责声明:我明白这不是我应该经常/永远做的事情,而且我知道有很多争论可以解释为什么这是一个坏主意。我对这是否可能感兴趣。有没有办法让我直接从routes.rb渲染布局而不通过Controller? 最佳答案 出于某种奇怪的原因,我想暂时
这个问题在这里已经有了答案:differentlayoutforsign_inactionindevise(8个答案)关闭7年前。如何更改设计Controller中的布局?