这些天一直在研究richviewedit,只是对其有关设置段落对齐的方式不解,今天上午终于将其解开。原来是在richstyle中将段落格式设置好,再在richviewedit中调用applyparastyle(num:integer)方法,其中,num是richstyle中定义的段落样式的索引(从零开始)。
richviewedit中做各种更改后,要记得调用format方法,以刷新richviewedit显示。另外也可通过applyparastyleconversion方法来设置,不过其于applyparastyle不同,是通过设置richstyle中的parastyles的索引号来实现。