2)添加资源:
<declare-styleable name="gallery1"> <attr name="androID:galleryItemBackground" /> </declare-styleable>
3)在您的相应活动中添加以下代码:
TypedArray a = obtainStyledAttributes(R.styleable.gallery1);int mgalleryItemBackground = a.getResourceID( R.styleable.gallery1_androID_galleryItemBackground,0);a.recycle();
4)然后将mgalleryItemBackground设置为视图的背景.您将在视图之外获得边框.
例如:
imageVIEw.setBackgroundResource(mgalleryItemBackground);总结
以上是内存溢出为你收集整理的android中gridview项的边框全部内容,希望文章能够帮你解决android中gridview项的边框所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)