我正在尝试使用以下代码创建一个弹出菜单:
import UIKit
class BeobachtungViewController: UIViewController, UIPopoverPresentationControllerDelegate {
@IBAction func addClicked(_ sender: AnyObject) {
// get a reference to the view controller for the popover
let popController = UIStoryboard(name: "Personenakte", bundle: nil).instantiateViewController(withIdentifier: "popoverId")
// set the presentation style
popController.modalPresentationStyle = UIModalPresentationStyle.popover
// set up the popover presentation controller
popController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.up
popController.popoverPresentationController?.delegate = self
popController.popoverPresentationController?.sourceView = sender as! UIView // button
popController.popoverPresentationController?.sourceRect = sender.bounds
// present the popover
self.present(popController, animated: true, completion: nil)
}
// UIPopoverPresentationControllerDelegate method
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) …Run Code Online (Sandbox Code Playgroud) 应用程序
<template>
<v-app id="inspire">
<v-navigation-drawer
v-model="drawer"
app
>
<v-list dense>
<v-list-item link>
<v-list-item-action>
<v-icon>mdi-home</v-icon>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>Home</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item link>
<v-list-item-action>
<v-icon>mdi-contact-mail</v-icon>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>Contact</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-navigation-drawer>
<v-app-bar
app
color="indigo"
dark
>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"/>
<v-toolbar-title>Application</v-toolbar-title>
</v-app-bar>
<v-content>
<v-container fluid>
<router-view></router-view>
</v-container>
</v-content>
<v-footer
color="indigo"
app
>
<span class="white--text">© 2019</span>
</v-footer>
</v-app>
</template>
Run Code Online (Sandbox Code Playgroud)
主页.vue:
<template>
<v-layout fluid>
<template>
<v-data-table
height="100%"
:headers="headers"
:items="desserts"
:items-per-page="10"
class="elevation-1"
style="margin: 0px; padding: 0px; width: 100%; height: 100%"
></v-data-table>
</template>
</v-layout>
</template> …Run Code Online (Sandbox Code Playgroud) 我想用 go 创建一个自定义的 kubernetes 资源。应用部署在 kubernetes 集群中。我想创建例如以下资源:
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: add-response-header
config:
add:
headers:
- "demo: injected-by-kong"
plugin: response-transformer
Run Code Online (Sandbox Code Playgroud)
到目前为止,我总是使用以下代码创建“标准”资源,例如一个秘密:
CreateSecret(name string, data map[string]string) error {
confs, err := rest.InClusterConfig()
if err != nil {
panic(err)
}
clientset, err = kubernetes.NewForConfig(confs)
i := clientset.CoreV1()
if _, err := i.Secrets(namespace).Create(&v1.Secret{
TypeMeta: metav1.TypeMeta{
Kind: "Secret",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
StringData: data,
Type: "Opaque",
}); err != nil {
return err
}
}
Run Code Online (Sandbox Code Playgroud)
此外,我尝试使用以下代码获取资源:
b, err …Run Code Online (Sandbox Code Playgroud) 我刚刚在 inkscape 中创建了一个图标。就像这里提到的,我将视口设置为 24x24 并将其保存为 svg 文件:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="drawing.svg"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
id="svg16"
version="1.1"
viewBox="0 0 6.3499999 6.3499997"
height="24"
width="24">
<defs
id="defs10" />
<sodipodi:namedview
lock-margins="true"
fit-margin-bottom="0"
fit-margin-right="0"
fit-margin-left="0"
fit-margin-top="0"
units="px"
showborder="true"
inkscape:snap-nodes="true"
inkscape:snap-others="true"
inkscape:object-nodes="false"
inkscape:snap-object-midpoints="false"
inkscape:snap-midpoints="false"
inkscape:guide-bbox="true"
showguides="true"
inkscape:window-maximized="0"
inkscape:window-y="37"
inkscape:window-x="1920"
inkscape:window-height="1041"
inkscape:window-width="1916"
inkscape:object-paths="false"
showgrid="false"
inkscape:document-rotation="0"
inkscape:current-layer="layer1"
inkscape:document-units="px"
inkscape:cy="15.424759"
inkscape:cx="14.537256"
inkscape:zoom="22.627417"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base" />
<metadata
id="metadata13">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> …Run Code Online (Sandbox Code Playgroud) 我想在log4j2中生成一个自定义Logger。我尝试了以下描述在这里:
java -cp log4j-core-2.6.jar org.apache.logging.log4j.core.tools.Generate$CustomLogger Logger TEST=550 PRODUKTION=200 > Logger.java
Run Code Online (Sandbox Code Playgroud)
我从这里获得了log4j-core-2.6.jar文件。如果尝试在终端中运行命令(我使用osx10.11.5),则会出现以下错误:
Error: Main method not found in class org.apache.logging.log4j.core.tools.Generate, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
Run Code Online (Sandbox Code Playgroud)
你知道我在做什么吗?
亲切的问候!
编辑:感谢Alexandre Cartapanis,我不得不将命令更改如下:
java -cp log4j-core-2.6.jar 'org.apache.logging.log4j.core.tools.Generate$CustomLogger' MyLogger TEST=550 PRODUKTION=200 > Logger.java
Run Code Online (Sandbox Code Playgroud) 我在ViewController中有一个Segment Control和一个Container.在容器中是一个PageViewController.如果单击"段控制"中的某个项目,则会更改"user"表的"active"值.(sqlite)表"user":
username text, active bool
user1, false
user2,true
Run Code Online (Sandbox Code Playgroud)
因此,如果单击"段控制"中的user1,表格将更改为
username text, active bool
user1, true
user2,false
Run Code Online (Sandbox Code Playgroud)
是否有一种方法可以使PageViewController中的所有ViewControllers识别数据库中的更改并使用新用户重新加载其数据.如果这不可能,那么最好的方法是什么?
亲切的问候
我在docker 容器中使用openpose。以下命令创建图像,其中检测到的关键点打印在原始图像上。
openpose -display=0 -image_dir=/data -write_images=/data -face=true -hand=true
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
我做了以下操作,使导航栏只是白色.
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
Run Code Online (Sandbox Code Playgroud)
所以我将每个UIViewController设置为"not under top/bot bar".这看起来像我想要的.但是当我制作一个UIImagePicker时,它看起来像这样:

所以我尝试了以下方法:
let imagePicker = UIImagePicker()
imagePicker.edgesForExtendedLayout = []
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我该怎么做?
请注意!