Android: How to maximize PreferenceFragment width (or get rid of margin)?

后端 未结 8 1101
误落风尘
误落风尘 2020-11-28 12:58

\"Android

\"FragmentsBC

8条回答
  •  没有蜡笔的小新
    2020-11-28 13:30

    Just an addition to this; the accepted answer did not work for me because the ListView itself does not have any padding set, it is set on the parent view (usually a LinearLayout). So instead, the following was necessary:

    ListView lv = (ListView) findViewById(android.R.id.list);
    ViewGroup parent = (ViewGroup)lv.getParent();
    parent.setPadding(0, 0, 0, 0);
    

提交回复
热议问题