[3.3.0] TextView走马灯getLayout()为空异常处理
This commit is contained in:
@@ -105,6 +105,9 @@ public class MarqueeTextView extends androidx.appcompat.widget.AppCompatTextView
|
||||
}
|
||||
|
||||
final int textWidth = getWidth() - getCompoundPaddingLeft() - getCompoundPaddingRight();
|
||||
|
||||
if (getLayout() == null) return;
|
||||
|
||||
final float lineWidth = getLayout().getLineWidth(0);
|
||||
final float gap = mCustomGap*textWidth;
|
||||
float ghostStart = lineWidth - textWidth + gap;
|
||||
|
||||
Reference in New Issue
Block a user