【Android】Spinner组件如何去除Padding左边距
Spinner左边有边距是因为item布局里自带了边距,所以只需要在getView里获取到item布局然后移除掉边距即可,字体大小也是如此。
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
view.setPadding(0, view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom());
return view;
}