我正在尝试使用带有Java 的Google Slides API 生成带有嵌套项目符号 的幻灯片。 我在实现它时遵循了文档,但是我得到了嵌套的项目符号但不是预期的(嵌套有不同的项目符号样式左对齐)。
请浏览图片和代码以更好地理解我的问题。
预期:
获得:
代码:
Requests.add(new Request().setInsertText(new InsertTextRequest().setObjectId(shapeId).setText("Bold\nItal 2\n\tFoo\n\tBar\n\tBla")) );
Requests.add(new Request().setCreateParagraphBullets(new CreateParagraphBulletsRequest().setObjectId(shapeId).setTextRange(new Range().setType("ALL")) ));
关于我哪里出错的任何建议......
最佳答案
基于关于 Bullet glyph Text style 的 Google Slide API 文档:
Like normal text, bullet glyphs have a text style that controls how the glyph is rendered. These text styles cannot be modified using the Slides API directly. However, if you use an
UpdateTextStyleRequest
to update a complete paragraph that includes a bullet, the Slides API updates the bullet glyph's text style to match.Bullet glyph text styles follow a slightly different inheritance hierarchy than normal text styles.
A bullet at a certain nesting level first inherits from the
TextStyle
set in theNestingLevel.bullet_style
field inside the bullet'sList
object.It next inherits from the corresponding
NestingLevel.bullet_style
in its parent placeholder'sList
.- Finally it seeks to inherit from remaining parent placeholder objects.
关于java - 使用java在幻灯片中创建段落项目符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52587282/