Android轮播控件 BGABanner

git下载和说明地址:https://github.com/bingoogolapple/BGABanner-Android


XML代码:

    
    
    
    
说明:父控件声明:

xmlns:app="http://schemas.android.com/apk/res-auto"


Style样式代码:

 
    

    
        
        
        
        
        
        
        
        
        
        
        
        
            
            
            
            
            
        
        
        
        
        
        
        
        
        
            
            
            
            
            
            
            
            
            
            
            
            
            
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    

Java调用代码:

   private void no() {
        List url = new ArrayList<>();
        BannerModel bannerModel = new BannerModel();
        bannerModel.imgs = url;
        mContentBanner.setAdapter(this);
        mContentBanner.setData(bannerModel.imgs, bannerModel.tips);
    }

    //轮播图监听
    public void fillBannerItem(BGABanner banner, View view, Object model, int position) {
        Glide.with(getActivity())
                .load(model)
                .placeholder(R.drawable.holder)
                .error(R.drawable.holder)
                .into((ImageView) view);
    }

配置代码:


compile 'cn.bingoogolapple:bga-banner:2.1.7@aar'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.github.bumptech.glide:glide:3.5.2'//图片加载库


你可能感兴趣的:(TaoNan项目总结篇)