0
我想以這樣的方式來顯示一些圖像(3或5或7等)的中間影像中心屏幕上,其餘分散在兩側,像這樣:如何將imageView移動到外部顯示器上?
+-------------+
[i] | [i] [i] [i] | [i]
+-------------+
我寫的:
for(int i=0;i<(numOfPages-1);i++){
ShadowedImageView image = new ShadowedImageView(this);
pagesArray[i] = image;
pagesArray[i].setId((i+1));
}
int firstPage = currentPage-((int) (numPagesToLoad/2));
int lastPage = (currentPage+((int) (numPagesToLoad/2)))+1;
for(int i=firstPage;i<lastPage;i++){
pagesArray[i].scale = 11;
pagesArray[i].download(someUrlToLoadImage);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.leftMargin = -20; // this not work !
params.addRule(RelativeLayout.RIGHT_OF, (firstPage+i));
layout.addView(pagesArray[i],params);
}
我有自定義的ImageView類,我把它們放在RelativeLayout中。
有啥問題? – blessenm
圖片不隱藏,請勿集中設置 – Nips
使用圖庫視圖。 –