diff --git a/README.md b/README.md index ac14681..28df3aa 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,38 @@ dependencies{ compile 'com.youth.banner:library:1.0' } ``` -##方法详解 +##方法 |方法名|参数|描述 |:---:|:---:|:---:| |setImages|url/resources| 设置轮播图片 +|setOnBannerClickListener|/|设置点击事件 + +##使用步骤 + +####1.在布局文件中添加Banner +```xml + +``` +#### 3.在Activity或者Fragment中配置BGARefreshLayout +```java +private Banner banner; +String[] images= new String[] {"url"}; +@Override +protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + banner = (Banner) findViewById(R.id.banner); + banner.setImages(images);//可以选择设置图片网址,或者资源文件 + banner.setOnBannerClickListener(new Banner.OnBannerClickListener() {//设置点击事件 + @Override + public void OnBannerClick(View view, int position) { + + } + }); + +} +``` +