- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
创建一个包含以下内容的 Activity
1)编辑文本(Commonsware RichEditText)
2) 带有以下按钮的工具栏
粗体、斜体、下划线、删除线、字体、居中对齐、左对齐、右对齐、两端对齐等
4) 一个保存按钮
用法:
用户输入文本并通过选择文本整体或部分进行编辑。效果应用于选定的文本。当用户在编辑器中完成编辑文本时,他单击保存按钮。一切都从 RichEditText 中读取并发送到数据库以供以后使用标签和 html 格式。我使用以下代码进行保存和检索。
Spanned s = Html.fromHtml("<i>Hi</i> There ! <b>how're you ?</b>");
et.setText(s);
//--save to string--
Editable e = et.getText();
String s2 = Html.toHtml(e);
//--restore from string--
Spanned s3 = Html.fromHtml(s2);
et.setText(s3);
来源:Copy to clipboard using commonsware cwac-richedit library
问题:
我必须将粗体、斜体、下划线、删除线、字体、居中对齐、左对齐、右对齐、两端对齐等应用到按钮中的选定文本 onClick()
工具栏不同于操作栏按钮。当在 RichEditText 上方的布局中进行选择时,有什么方法可以将整个 View 显示在操作栏中?比如说 Horizontal LinearLayout 或一些自适应布局?
如果有人能告诉他如何通过单击按钮将任何一种效果添加到所选文本,那将非常有帮助。我看到了下面的方法,但不确定T值是多少。
myRichEditText.applyEffect(effect, value);
谢谢。
最佳答案
Is there any way I can place the entire view shown in the actionbar when selection is made in a layout above the RichEditText?
没有。您的工具栏需要位于主 UI 中,例如 RichEditText
小部件本身的上方。
It would be really helpfull if some one can tell he how to add any one effect to a selected text on click of a button.
引用 the documentation :
applyEffect()
changes the current selection, applying or removing an effect (e.g., making the selection bold). The first parameter is the effect to apply (e.g.,RichEditText.BOLD
). The second parameter is the new value for the effect. Many effects take boolean values, soapplyEffect(RichEditText.BOLD, true)
would format the current selection as bold.
FWIW,我计划为 RichEditText
提供一个标准的工具栏选项,但我不太可能在今年秋天之前有机会这样做。
关于android - 在 android 中向 Commonsware RichEditText 添加自定义控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24592998/
本文整理了Java中com.commonsware.cwac.security.ZipUtils类的一些代码示例,展示了ZipUtils类的具体用法。这些代码示例主要来源于Github/Stackov
在 commonsware 书籍教程 #6 中,我严格按照说明进行操作。我创建了包含 zip 下载中\library 目录内容的并行目录。我确保 empublite 项目处于合规级别 1.6。我将 A
最初,我有自己的 Adapter 扩展了 BaseAdapter,它工作正常。然后,我尝试通过以下代码采用commonsware EndlessAdapter: public class MyEndl
我正在尝试实现 Commonsware CWAC-Camera,但遇到了将其整合到现有 fragment 中的问题。 我遇到无法使用 .add 或 .replace 的问题,它要我将 CameraFr
应用构建失败并显示以下错误消息 com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not find an
我在我的 android 项目中使用合并列表,直到现在我只是将源代码与我的其余代码一起推送到我的 src 根目录中。但是我没有修改任何东西,所以我认为是时候将这些东西作为库包含进来了。我克隆了第一个
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 9 年前。 Improve t
本文整理了Java中com.commonsware.cwac.security.ZipUtils.unzip()方法的一些代码示例,展示了ZipUtils.unzip()的具体用法。这些代码示例主要来
在我的应用程序中,我有 CommosWare 的 WakefulIntentservice。从 doWakefulWork 方法中,我调用了几个自己编写的方法。例如: @Override protec
创建一个包含以下内容的 Activity 1)编辑文本(Commonsware RichEditText) 2) 带有以下按钮的工具栏 粗体、斜体、下划线、删除线、字体、居中对齐、左对齐、右对齐、两端
我在我的应用程序中添加了 tedpicker https://github.com/ParkSangGwon/TedPicker 但是现在几个星期以来,当我尝试将 gradle 与互联网同步时,这个错
我正在使用通用软件 WakefulIntentService 进行唤醒工作。与使用 commonsware library 相比有什么优势吗?而不是 WakefulBroadcastReceiver来
我正在将 CWAC StreamProvider 集成到我的代码中,但在运行我的代码后,我在 logcat 中看到无法获取提供程序 com.commonsware.cwac.provider.Stre
我正在按照自己的方式完成 CommonsWare master book 的 4.7 版。我正在学习教程 #12。我的问题与 ModelFragment 中的 deliverModel() 方法有关。
我是一名优秀的程序员,十分优秀!