几句设置部件适应屏幕:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); expList = getExpandableListView(); metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); width = metrics.widthPixels; //this code for adjusting the group indicator into right side of the view expList.setIndicatorBounds(width - GetDipsFromPixel(50), width - GetDipsFromPixel(10)); expList.setAdapter(new ExpAdapter(this)); }