我正在尝试实现自定义的IconPageIndicator - viewpager.我想自定义com.viewpagerindicator.IconPageIndicator中显示的图标的边距和填充.所以我编写了自定义的IconPageIndicator和CustomLinearLayout.我更改了CustomLinearLayout中的dividerPadding变量.这是代码.但这似乎不起作用.边距和填充仍然相同.有帮助吗?
class CustomLinearLayout extends LinearLayout {
private static final int[] LL = new int[] {
/* 0 */ android.R.attr.divider,
/* 1 */ android.R.attr.showDividers,
/* 2 */ android.R.attr.dividerPadding,
};
private static final int LL_DIVIDER = 10;
private static final int LL_SHOW_DIVIDER = 2;
private static final int LL_DIVIDER_PADDING = 10;
private Drawable mDivider;
private int mDividerWidth;
private int mDividerHeight;
private int mShowDividers;
private int mDividerPadding;
public CustomLinearLayout(Context context, int themeAttr) {
super(context);
TypedArray a = context.obtainStyledAttributes(null, LL, themeAttr, 0); …Run Code Online (Sandbox Code Playgroud)