Web浏览器中是否有默认选项的替代品,例如chrome允许我在webapp中添加链接或按钮并在主屏幕中创建图标?
例如,我有我的webapp,我想在main.html中使用一个链接或按钮来执行脚本并在主屏幕中创建图标.我想不可能.那么有没有其他方法可以在Web浏览器中模拟这个默认选项?
另外,我想指定主屏幕中显示的图标.我怎样才能做到这一点?
我正在尝试从本地服务器下载文件(也许将来我需要在其他服务器上下载)。当我单击链接以在浏览器中下载文件时,会出现此消息“about:blank#blocked”。
我正在使用 axios 和 vue.js。. 代码是这样的:
downloadItem(urlDoc) {
console.log(urlDoc);
axios({
method: 'get',
url: urlDoc,
responseType: 'arraybuffer',
}).then(function(response) {
let blob = new Blob([response.data], { type: 'image/png' })
let link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = 'image.png'
link.click()
})
}
Run Code Online (Sandbox Code Playgroud)
以前我添加了一个 chrome 扩展来支持呼叫请求。扩展名为allow-control-allow-origin。
谢谢。
我需要在framelayout中创建一个listview.
这是我的代码:
<FrameLayout
android:id="@+id/layout_ejercicios"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_alignParentStart="true"
android:layout_below="@+id/layout_info"
android:orientation="vertical">
<ListView
android:id="@+id/listViewEjercicios"
android:layout_width="match_parent"
android:layout_height="match_parent"></ListView>
<include
android:id="@+id/tool_bar_ejercicios"
layout="@layout/toolbar" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabCrearEntrenamiento"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:clickable="true"
android:src="@drawable/ic_action_add"
app:fabSize="normal"
app:layout_anchor="@id/layout_ejercicios"
app:layout_anchorGravity="bottom|right|end" />
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但第一行总是被工具栏隐藏.其余的行看起来不错.
我尝试在row_layout.xml中添加padding_top,但不是解决方案.
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rowTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="21sp" >
</TextView>
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?