如何更改 PE.SDK 中的工具栏操作图标以实现本机反应?

发布于 2025-01-10 21:27:34 字数 1703 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

今天小雨转甜 2025-01-17 21:27:34

对于 iOS:
为了在 iOS 上的编辑器中交换图标,您需要提供一个可用于 PESDK 类的图像块:

首先,您需要导入 RNPhotoEditorSDK 标头在您的 AppDelegate.m/AppDelegate.mm 文件中:

#import <RNPhotoEditorSDK/RNPhotoEditorSDK.h>

然后,您可以在打开编辑器之前设置图像块。我们建议将代码放置在同一文件的 didFinishLaunchingWithOptions 函数内。

[PESDK setBundleImageBlock:^UIImage * _Nullable(NSString * _Nonnull identifier) {
  if ([identifier isEqualToString:@"imgly_icon_save"]) {
    return [UIImage imageNamed:@"imgly_icon_approve_44pt"];
  }
  return nil;
}];

对于Android:

您需要为SDK的相应图标创建自定义资源文件。只需提供与 SDK 中使用的文件名相同的资源文件即可。

<?xml version="1.0" encoding="utf-8"?>


<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:viewportWidth="24"
        android:viewportHeight="24"
        android:width="24dp"
        android:height="24dp">
    <path
        android:pathData="M20.999994 7l-1.4 -1.4 -10.6000001 10.6 -4.2 -4.2 -1.4 1.4 5.6 5.6z"
        android:fillColor="?attr/imgly_icon_color_secondary" />
</vector>

此信息可以在此处< /a>.

For iOS:
In order to exchange icons in the editor on iOS, you need to provide an image block that is available natively for the PESDK class:

First, you need to import the RNPhotoEditorSDK header inside your AppDelegat.m/AppDelegate.mm file:

#import <RNPhotoEditorSDK/RNPhotoEditorSDK.h>

Then, you can set the image block before the editor is opened. We recommend placing the code inside the didFinishLaunchingWithOptions function in the same file.

[PESDK setBundleImageBlock:^UIImage * _Nullable(NSString * _Nonnull identifier) {
  if ([identifier isEqualToString:@"imgly_icon_save"]) {
    return [UIImage imageNamed:@"imgly_icon_approve_44pt"];
  }
  return nil;
}];

For Android:

You will need to create custom resource files for the corresponding icons of the SDK. Simply provide a resource file with the same filename as used in the SDK.

<?xml version="1.0" encoding="utf-8"?>


<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:viewportWidth="24"
        android:viewportHeight="24"
        android:width="24dp"
        android:height="24dp">
    <path
        android:pathData="M20.999994 7l-1.4 -1.4 -10.6000001 10.6 -4.2 -4.2 -1.4 1.4 5.6 5.6z"
        android:fillColor="?attr/imgly_icon_color_secondary" />
</vector>

This information can be found here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文