看起来spacingMult
通过将间距乘以提供的数字来更改间距,将提供的数字spacingAdd
添加到原始间距值以及includePad
某些语言的额外间距因素。
如果 Google 没有您感兴趣的某些内容的文档,那么查看源代码中的注释有时会有所帮助。例如,如果您查看该StaticLayout.java
文件,您将看到构造函数调用另一个方法,其中spacingMult
和spacingAdd
参数作为该方法的参数。该方法的注释如下:
/**
* Set line spacing parameters. The default is 0.0 for {@code spacingAdd}
* and 1.0 for {@code spacingMult}.
*
* @param spacingAdd line spacing add
* @param spacingMult line spacing multiplier
* @return this builder, useful for chaining
* @see android.widget.TextView#setLineSpacing
*/
这是setLineSpacing()
他们在里面提到的评论。
/**
* Sets line spacing for this TextView. Each line will have its height
* multiplied by <code>mult</code> and have <code>add</code> added to it.
*
* @attr ref android.R.styleable#TextView_lineSpacingExtra
* @attr ref android.R.styleable#TextView_lineSpacingMultiplier
*/
同样对于includePad
:
/**
* Set whether to include extra space beyond font ascent and descent (which is
* needed to avoid clipping in some languages, such as Arabic and Kannada). The
* default is {@code true}.
*
* @param includePad whether to include padding
* @return this builder, useful for chaining
* @see android.widget.TextView#setIncludeFontPadding
*/