我在Stackpanel里面有两个网格.第一个网格名为GridX.最初在网格内部有一个文本框的2D数组(RowDefs/ColumnDefs).XAML中的TextBox定义是
<TextBox x:Name="A1" Grid.Row="4" Grid.Column="5" TextAlignment="Center" />
Run Code Online (Sandbox Code Playgroud)
我希望以与GridX的一部分相同的位置以编程方式添加TextBlock.
效果必须是这样的
<TextBlock Grid.Row="4" Grid.Column="5"
HorizontalAlignment="Left" VerticalAlignment="Top" Text="10" FontSize="8"/>
Run Code Online (Sandbox Code Playgroud)
如何添加这个.我试过这个:
TextBlock tblock = new TextBlock();
GridX.SetColumn(tblock, cIndex);
GridX.SetRow(tblock, rIndex);
Run Code Online (Sandbox Code Playgroud)
但失败了.
我再试一次:
int rIndex = Grid.GetRow(txtBox);
int cIndex = Grid.GetColumn(txtBox);
TextBlock tblock = new TextBlock();
tblock.VerticalAlignment = VerticalAlignment.Top;
tblock.HorizontalAlignment = HorizontalAlignment.Left;
tblock.FontSize = 8;
tblock.Text = rc[i, j - 1];
Grid.SetColumn(tblock, cIndex);
Grid.SetRow(tblock, rIndex);
txtBox.MaxLength = 1;
Run Code Online (Sandbox Code Playgroud)
现在问题是TextBlock不可见.TextBox隐藏它.你能帮我吗
我需要在viewDidload事件中获取并显示最后从照片库中拍摄的3张照片而不进行任何点击.
在此步骤之后,当我滚动滚动视图时,我应该获得其他照片3乘3.
你知道用swift做这个的正确方法吗?谢谢.

我在 v13+ 上使用 Discord.js Bot 时遇到问题。我收到[DISALLOWED_INTENTS]错误。我怎样才能解决这个问题?谢谢。
(node:16060) UnhandledPromiseRejectionWarning: Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted. at WebSocketManager.createShards (C:\Users\schne\Desktop\Zeltux_v1.5.2\node_modules\discord.js\src\client\websocket\WebSocketManager.js:260:15)
[05:24:04] (node:16060) UnhandledPromiseRejectionWarning: Unhandled promise rejection.
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[05:24:04] (node:16060) [DEP0018] DeprecationWarning: Unhandled promise …Run Code Online (Sandbox Code Playgroud) 你能用2.0驱动程序帮助我正确运行"拉(删除)".
我有一个这样的集合,我想删除第一个跟随者字段命名为fethiye的追随者.
{
"_id": ObjectId("554e05dfc90d3d4dfcaa2aea"),
"username": "bodrum",
"followerList": [
{
"_id": ObjectId("554e0625a51586362c33c6df"),
"follower": "fethiye",
"avatar": "fethiye.png"
},
{
"_id": ObjectId("554e0625a51586362c33c6df"),
"follower": "izmir",
"avatar": "izmir.png"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我该如何修复此查询?
var filter = new BsonDocument("username", "bodrum");
var update = Builders<Person>.Update.Pull("followerList:follower", "fethiye");
Person pr = collection.FindOneAndUpdateAsync(filter, update).Result;
Run Code Online (Sandbox Code Playgroud)
谢谢.
我尝试在版本 2 中设置 Traefik,但DNS_PROBE_FINISHED_NXDOMAIN在我的浏览器中只收到“404 Page not found”或错误。
当我检查路由器的 API 端点时,我可以看到在 Traefik 中启用了我的两个容器并且规则是正确的。
curl http://localhost:8080/api/http/routers
[{"entryPoints":["web","secure"],"service":"gotify-gotify","rule":"Host(`sub2.example.org`)","tls":{"certResolver":"letsencrypt"},"status":"enabled","using":["secure","web"],"name":"gotify@docker","provider":"docker"},{"entryPoints":["web","secure"],"service":"nextcloud-cloud","rule":"Host(`sub.example.org`)","tls":{"certResolver":"letsencrypt"},"status":"enabled","using":["secure","web"],"name":"nextcloud@docker","provider":"docker"}]
Run Code Online (Sandbox Code Playgroud)
但是在“sub2”上我根本没有网站,在“sub”上我得到“404页面未找到”。我为“*”设置了 DNS 条目,因此所有子域都转到同一服务器。
我为 docker 容器设置了以下标签
labels:
traefik.enable: true
traefik.http.routers.nextcloud.rule: "Host(`sub.example.org`)"
traefik.http.routers.nextcloud.entrypoints: "web, secure"
traefik.http.routers.nextcloud.tls.certresolver: "letsencrypt"
Run Code Online (Sandbox Code Playgroud)
这是我的 Traefik 配置traefik.toml
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.secure]
address = ":443"
[providers.docker]
exposedByDefault = false
network = "traefik"
[certificatesResolvers.letsencrypt.acme]
email = "me@example.org"
storage = "acme.json"
[certificatesResolvers.letsencrypt.acme.httpChallenge]
entryPoint = "web"
[api]
insecure = true
debug = true
dashboard = false
Run Code Online (Sandbox Code Playgroud)
Traefik 本身作为 docker 容器运行。
version: …Run Code Online (Sandbox Code Playgroud) 如何在iOS上解析"MongoDB datetime(ISO Date)"到NSDate(swift和objective-c)
这是json的结果:
{
"mongodate" : "2015-06-11T14:16:56.643Z"
}
Run Code Online (Sandbox Code Playgroud)
我也回答了这个问题.
我正在使用UIFeedback Haptic Engine与swift 2.3类似:
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.Warning)
Run Code Online (Sandbox Code Playgroud)
和
let generator = UIImpactFeedbackGenerator(style: .Heavy)
generator.impactOccurred()
Run Code Online (Sandbox Code Playgroud)
今天我遇到了这样一种新的错误,但是找不到问题.你有什么主意吗?
UIFeedbackHapticEngine _deactivate] called more times than the feedback engine was activated
Run Code Online (Sandbox Code Playgroud)
细节:
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1863e41c0 __exceptionPreprocess
1 libobjc.A.dylib 0x184e1c55c objc_exception_throw
2 CoreFoundation 0x1863e4094 +[NSException raise:format:]
3 Foundation 0x186e6e82c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 UIKit 0x18cc43fb8 -[_UIFeedbackEngine _deactivate]
5 UIKit 0x18cad781c -[UIFeedbackGenerator __deactivateWithStyle:]
Run Code Online (Sandbox Code Playgroud) \xe2\x9c\x96 安装 Bundler\n错误 您的 Ruby 版本是 2.6.8,但您的 Gemfile 指定为 2.7.4
\n\xe2\x9c\x96 安装 Bundler\n错误 错误:看起来您的 iOS 环境设置不正确。请访问https://reactnative.dev/docs/next/environment-setup并遵循适用于 macOS 和 iOS 的 React Native CLI 快速入门指南。
\n但我的Ruby版本是2.7.5
\n我尝试运行以下命令:
\nyarn global remove react-native-cli "after install again"\nrvm install ruby/latest\nnpm install -g @react-native/cli\nRun Code Online (Sandbox Code Playgroud)\n但没有任何效果:(
\n当我在react-native-reanimated尝试运行我的应用程序后安装在我的项目中时,它显示以下错误:
Cause: executing external native build for cmake /Users/MyPC/React-Native/Citi-App-Old-version/node_modules/react-native-reanimated/android/CMakeLists.txt
Run Code Online (Sandbox Code Playgroud)
使用版本:
"react": "16.13.1",
"react-native": "0.63.0",
"react-native-reanimated": "^2.8.0",
Run Code Online (Sandbox Code Playgroud)
你能帮我解决这个错误吗?
ios ×4
mongodb ×2
react-native ×2
swift ×2
c# ×1
datetime ×1
discord.js ×1
docker ×1
gridview ×1
ios10 ×1
ios15 ×1
javascript ×1
macos ×1
networking ×1
node.js ×1
photolibrary ×1
swift5 ×1
traefik ×1
uiscrollview ×1
wpf ×1
xcode13 ×1