【发布时间】:2017-12-17 13:00:14
【问题描述】:
我很难找到如何扩展默认 PhotoEditor SDK 的信息。我需要在取消和接受按钮所在的默认 UI 面板中添加一个按钮。有没有办法做到这一点? 感谢您的帮助!
【问题讨论】:
标签: java android photoeditorsdk
我很难找到如何扩展默认 PhotoEditor SDK 的信息。我需要在取消和接受按钮所在的默认 UI 面板中添加一个按钮。有没有办法做到这一点? 感谢您的帮助!
【问题讨论】:
标签: java android photoeditorsdk
是的,你可以。
扩展视图类 ly.img.android.ui.widgets.ImgLyTitleBar
重载此布局(这意味着,将此布局放在您的应用程序 res 文件夹中而不重命名它)并将 ly.img.android.ui.widgets.ImgLyTitleBar 替换为您的类。 https://github.com/imgly/pesdk-android-demo/blob/master/default_res_files/res/layout/imgly_activity_photo_editor.xml
通过重载此布局添加您的按钮 https://github.com/imgly/pesdk-android-demo/blob/master/default_res_files/res/layout/imgly_widget_actionbar.xml
在 ImgLyTitleBar 扩展类中添加按钮逻辑。
最好, 斯文
【讨论】:
((View) MyCustomExtensionOfImgLyTitleBar.this.getParent()).findViewById(ly.img.android.R.id.editorImageView)。但这会返回无法转换为 ImageView 的 EditorPreview 类的实例。而且我没有找到获取图像的方法。我还发现了 R.id.image 和 R.id.action_image。但这与当前无关,即我得到的撤消按钮。谢谢。