我正在努力添加facebook api与ionic/cordova集成,我正在尝试找到为我的应用程序生成的调试哈希键:
ionic build android
Run Code Online (Sandbox Code Playgroud)
我知道它会在/userhomedir/.android/debug.keystore中生成一个新的.keystore文件.但它设置为别名和密码是什么?如何在cordova为我的应用程序创建它之后检索此哈希键.在构建过程中,我没有看到哈希键被打印在任何地方.
我需要生成的哈希密钥给Facebook API使用他们在SDK上的签名
当它以离子连接时,我试图在线条之间填充颜色。当四线相互接触时,我想在线条之间填充颜色。为此,我使用触摸事件创建了一个画布演示。请帮助解决我的问题。
我们在画布框中有 4 条线,我们将拖动它们并连接每条线并给出一个形状线框。这意味着我们的线现在连接了线之间的填充颜色,因此框填充了颜色。
html文件:
<canvas #canvasDraw width="300" height="300" (touchstart)="handleTouchStart($event)"
(touchmove)="handleTouchmove($event)"
(touchend)="handleTouchEnd($event)">
You need a browser that supports HTML5!
</canvas>
Run Code Online (Sandbox Code Playgroud)
.ts 文件:
import { Component, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
@ViewChild('canvasDraw', { static: false }) canvas: ElementRef;
canvasElement: any;
lines: any[];
isDown: boolean = false;
startX: number;
startY: number;
nearest: any;
offsetX: any;
offsetY: any;
constructor() {
}
ngAfterViewInit() {
this.canvasElement = this.canvas.nativeElement;
this.lines = [];
this.lines.push({ x0: …Run Code Online (Sandbox Code Playgroud) 我正在创建一个使用bootstrap构建的HTML页面.以下是hello.js文件的最终HTML代码和代码:
document.getElementById("subm").onclick = function () {
alert("Hello WOrld");
}Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<link rel="stylesheet" href="/stylesheets/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
</html>
<body>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="javascripts/bootstrap.min.js"></script>
<script src="javascripts/hello.js"></script>
<h1>Calculator</h1>
<form class="form-horizontal center1">
<div class="control-group">
<label for="num1" class="control-label">Number1</label>
<div class="controls">
<input id="num1" type="number" placeholder="Enter an Integer">
</div>
</div>
<div class="control-group">
<label for="num2" class="control-label">Number2</label>
<div class="controls">
<input id="num2" type="number" placeholder="Enter an Integer">
</div>
<div class="control-group">
<label for="options" class="control-label">Options</label>
<div class="controls"><br>
<select id="options">
<option value="+">+</option>
<option value="-">-</option>
<option …Run Code Online (Sandbox Code Playgroud)我曾经在Google Play上发布一个离子应用程序,但今天早上我收到以下警告:“您的应用程序现在以API 26级为目标。但是,它现在应该以API 28级为目标...”
我正在使用Cordova 6.3.0,如何将它定位到API 28?
这是我的离子信息:
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4
Cordova:
cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 6.3.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 14 other plugins)
System:
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version
Run Code Online (Sandbox Code Playgroud)
像到目前为止一样,我在本地构建应用程序时没有错误消息,该警告仅适用于Google Play平台。
这是我通常使用的命令行:
npm i
cordova platform rm android
ionic cordova platform add android@6.3.0 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用这个构建 ionic android 应用程序部署到设备来构建离子 Android 应用程序
但当我运行此命令时显示错误: apksigner verify HelloWorld.apk
错误:
D:\ionic\demoAds1>apksigner verify HelloWorld.apk
'apksigner' is not recognized as an internal or external command,
operable program or batch file.
D:\ionic\demoAds1>
Run Code Online (Sandbox Code Playgroud)
知道该怎么做吗?
在数据表 (DT) 中设置自定义行条纹/行条纹颜色的“最佳”方法是什么?
我正在使用数据表 (DT) 创建交互式表格(例如通过 rmarkdown 的 HTML),具有下载功能等。这就是为什么我不使用 Huxtable 或任何其他表格格式包,理想情况下我不必设置样式在将其发送到数据表之前,首先将表放在另一个包中 - 尽管如有必要/最佳可用选项对此开放。
这是一个独立的行条带化示例,根据此处显示的示例进行修改,answer#1 ( https://src-bin.com/en/q/1b3261f ),类似于此不成功的尝试。一个问题是悬停颜色不再有效,尽管它是应用于任何存在的颜色?另一个是行颜色在按列重新排序后保持原始行数据 - 不确定这种默认行为是否是我想要的 - 是否容易更改?
DT::datatable(head(iris, 20),
extensions = 'Buttons',
options=list(dom = 'Bfrtip',
buttons = c('excel','csv','print'),
rowCallback=JS(
'function(row,data) {
if($(row)["0"]["_DT_RowIndex"] % 2 <1)
$(row).css("background","#f2f9ec")
}')))
Run Code Online (Sandbox Code Playgroud)
这里有一个选项可以按值为单元格的背景着色,这不是我所追求的: color-cells-in-dt-datatable-in-shiny
Datatables(dot)net datatables.net/manual/styling/theme-creator有一个示例样式表,它创建了一大堆 CSS(357 行代码),大概可以在 style.css 文件中使用它来执行所需的操作(行条纹,自定义颜色)?当我认为我的目的的秘诀就是这行代码(如下)时,这对我来说似乎有点过分了。请注意,数据表示例的默认行为具有独立于初始行号的条带化(参见上面的代码,条带化保留在原始原始数据中)。我可以将下面的代码直接放入 r 数据表代码中吗,例如上面的例子?
table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd {`
background-color` `: ` `#f9f9f9` `; }`
Run Code Online (Sandbox Code Playgroud) 我想使用 ion-slides 方法 getActiveIndex() 但是当我将 ion-slides 作为提供程序导入时,出现此错误:
NullInjectorError:没有 ChangeDetectorRef 的提供者!
我不知道为什么我必须将它添加到提供者中。即使我添加了这个,我还有另一个提供者:ElementRef...
如果你看看我的代码,你能告诉我我做错了什么吗?
谢谢!
liste.page.ts :
import {IonSlides} from '@ionic/angular';
@Component({
selector: 'app-liste',
templateUrl: './liste.page.html',
styleUrls: ['./liste.page.scss'],
})
export class ListePage {
constructor(private ionSlides: IonSlides) { }
slideChanged() {
console.log(this.ionSlides.getActiveIndex());
}
}
Run Code Online (Sandbox Code Playgroud)
liste.page.html:
<ion-slides [options]="sliderConfig" (ionSlideTransitionEnd)="slideChanged()">
<ion-slide *ngFor="let item of items; let i = index">
{{item.name}}
</ion-slide>
</ion-slides
Run Code Online (Sandbox Code Playgroud)
离子信息:
ionic (Ionic CLI) : 4.9.0
Ionic Framework : @ionic/angular 4.1.2
@angular-devkit/build-angular : 0.13.6
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.6
@ionic/angular-toolkit : 1.4.1
Run Code Online (Sandbox Code Playgroud) 我正在使用 ion-slide 并且在幻灯片中,我添加了一个 HTML 视频元素,我想在幻灯片更改时获取活动 ion-slide 视频元素的 ID。
这是我的 ts 代码:
@ViewChild(IonSlides, { static: false }) slides: IonSlides;
slideOpts = {
direction: 'vertical'
};
mainArray = [
{
id: 0,
thumbnailUrl: 'https://i.picsum.photos/id/803/200/300.jpg',
mp4: 'https://www.w3schools.com/html/mov_bbb.mp4',
ogg: 'https://www.w3schools.com/html/mov_bbb.ogg'
},
{
id: 1,
thumbnailUrl: 'https://i.picsum.photos/id/803/200/300.jpg',
mp4: 'https://www.w3schools.com/html/mov_bbb.mp4',
ogg: 'https://www.w3schools.com/html/mov_bbb.ogg'
},
{
id: 2,
thumbnailUrl: 'https://i.picsum.photos/id/803/200/300.jpg',
mp4: 'https://www.w3schools.com/html/mov_bbb.mp4',
ogg: 'https://www.w3schools.com/html/mov_bbb.ogg'
},
{
id: 3,
thumbnailUrl: 'https://i.picsum.photos/id/803/200/300.jpg',
mp4: 'https://www.w3schools.com/html/mov_bbb.mp4',
ogg: 'https://www.w3schools.com/html/mov_bbb.ogg'
}
];
playvideo() {
let videoPlayer1: HTMLVideoElement = <HTMLVideoElement>document.getElementById(this.mainArray[this.index].id)
videoPlayer1.pause();
videoPlayer1.currentTime = 0;
const …Run Code Online (Sandbox Code Playgroud) 我想发布多部分表单数据,为此,我们可以这样做:
\n\nlet formData = new FormData()\nformData.append(\'myfile\', \'your blob\')\n\nthis.http.post(url, formData)\nRun Code Online (Sandbox Code Playgroud)\n\n但我不知道如何将相机图像转换为斑点。我正在使用本机相机插件,这里是我的代码:
\n\n cameraOptions: CameraOptions = {\n quality: 20,\n destinationType: this.camera.DestinationType.DATA_URL,\n encodingType: this.camera.EncodingType.JPEG,\n mediaType: this.camera.MediaType.PICTURE,\n sourceType: this.camera.PictureSourceType.PHOTOLIBRARY\n }\n\nconstructor(public camera: Camera){}\n\ntakePhoto() {\n return new Promise(resolve => {\n this.camera.getPicture(this.cameraOptions).then((imageData) => {\n resolve(imageData);\n }, (err) => {\n resolve(err);\n });\n });\n }\nRun Code Online (Sandbox Code Playgroud)\n\n我为 blob 尝试了以下代码:
\n\ndataURLtoBlob(dataURL) {\n debugger;\n // convert base64/URLEncoded data component to raw binary data held in a string\n let byteString: string;\n if (dataURL.split(\',\')[0].indexOf(\'base64\') >= 0) {\n byteString = atob(dataURL.split(\',\')[1]);\n …Run Code Online (Sandbox Code Playgroud) 之前也曾提出过类似的问题,但我找不到确切的答案...
在本UserData节中,我有一个需要访问其自己的公共IP的EC2实例的定义:
"MyEC2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"SubnetId": {
"Fn::ImportValue": {
"Fn::Sub": "${NetworkStackName}-SubnetID"
}
},
"ImageId": "ami-xxxx",
"InstanceType": { "Ref": "InstanceTypeParameter" },
"IamInstanceProfile": { "Ref": "MasterInstanceProfile" },
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"#!/bin/bash -v\n",
" PUBLIC_IP=",
{
"Fn::GetAtt": ["MyEC2Instance", "PublicIp"]
},
" /usr/local/bin/docker-compose -f /docker-compose.yml up -d\n"
]
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
通常,通过可以很容易地访问它"Fn::GetAtt": ["MyEC2Instance", "PublicIp"],但是在这种情况下,这会引发“循环依赖项错误”-确保这样做确实有意义,但是我该如何解决呢?
javascript ×3
android ×2
cordova ×2
css ×2
html ×2
ionic3 ×2
amazon-ec2 ×1
angular ×1
angularjs ×1
api ×1
dt ×1
ionic4 ×1
r ×1
typescript ×1