Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
youth5201314 committed Apr 26, 2016
1 parent 8976dff commit 892fca8
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,38 @@ dependencies{
compile 'com.youth.banner:library:1.0'
}
```
##方法详解
##方法
|方法名|参数|描述
|:---:|:---:|:---:|
|setImages|url/resources| 设置轮播图片
|setOnBannerClickListener|/|设置点击事件

##使用步骤

####1.在布局文件中添加Banner
```xml
<com.youth.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="200dp" />
```
#### 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) {

}
});

}
```

0 comments on commit 892fca8

Please sign in to comment.