我正在使用 React Native 构建 Android 和 iOS 应用程序。我用来react-navigation在屏幕之间导航。
问题在于 iOS 上的导航与 Android 上的导航不同(下图)。我希望它们都像 Android 上一样,那么如何在 iOS 上隐藏“搜索汽车”呢?
我已将导航选项设置如下:
Screen.navigationOptions = () => {
const title = 'Search location';
return {
headerTitleStyle: {
fontSize: 18,
color: styles.headerTitle.color,
paddingTop: 5,
height: 40
},
headerStyle: {
backgroundColor: '#fdfdfd'
},
title
};
};
Run Code Online (Sandbox Code Playgroud) 我想将 pdf 文件嵌入到我的 html 中(使用 embed 标签或 iframe 标签)。
我尝试过以下两种。所有这些都可以在 Firefox 上正常运行,但不能在 chrome、chromium 和 android 浏览器上运行。
<embed type="application/pdf" src="myfile.pdf"></embed>
<iframe class="embed-responsive-item" src="myfile.pdf" allowfullscreen></iframe>Run Code Online (Sandbox Code Playgroud)
我还尝试使用php读取pdf文件,然后使用iframe来显示它,如下所示
header("Content-type: application/pdf");
header("Content-Disposition: inline; filename=".$_GET['pdf']);
@readfile($CONFIG['PDF']."/".$_GET['pdf']);
Run Code Online (Sandbox Code Playgroud)
同样,这不适用于 chrome / chromium 和移动浏览器。它仅适用于桌面版 Firefox。
我不确定这是否是重要信息,但我还设置了 X-Frame-Options“ALLOW-FROM mydomain.com”
在这里您将找到问题所在的示例。
有没有其他方法可以在网页上嵌入 pdf 文件?