2
之間的空間,我有HorizontalScrollView,問題是,經過我添加的意見,我的這些觀點之間的空白。這裏是一個事先知情同意:
HorizontalScrollView補充意見
這裏是類的代碼:
public class HomeFeatureLayout extends HorizontalScrollView {
public HomeFeatureLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public HomeFeatureLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public HomeFeatureLayout(Context context) {
super(context);
}
public void setFeatureItems() {
LinearLayout internalWrapper = new LinearLayout(getContext());
internalWrapper.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
internalWrapper.setOrientation(LinearLayout.HORIZONTAL);
addView(internalWrapper);
// this.mItems = items;
for (int i = 0; i < 10; i++) {
ImageView im = new ImageView(getContext());
im.setImageResource(R.drawable.aaaa);
im.setScaleType(ScaleType.CENTER_INSIDE);
im.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
internalWrapper.addView(im);
}
}
}
而且MainActivity:
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
HomeFeatureLayout home = new HomeFeatureLayout(this);
home.setFeatureItems();
home.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
setContentView(home);
}
爲什麼有每2 IMA之間的空格水電站?
但我應該在哪裏過,我想兩個圖像之間的空間,我想只有空間之間的兩個圖像和該空間不應該顯示在屏幕上的圖像顯示時,這應該工作sem像viapager.setmargin()方法 – Mahesh 2014-10-10 10:02:21
我想給兩個圖像之間的空間我用這個庫,所以我應該改變這個 – Mahesh 2014-10-10 10:03:58