@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); this.SCREEN_WIDTH = dm.widthPixels; // 获取分辨率宽度 this.SCREEN_HEIGHT = dm.heightPixels; viewGroup = new MyViewGroup(this); viewGroup.setScrollListener(this); setContentView(viewGroup); for (int i = 0; i < 11; i++) { this.addFooterWeek(); } }
private void addFooterWeek() { viewGroup.addFooterView(this.addWeek()); }
private void addHeaderWeek() { viewGroup.addHeaderView(this.addWeek()); }