Skip to content

Commit

Permalink
修改了readme文件,添加重影解决方案
Browse files Browse the repository at this point in the history
  • Loading branch information
3159275585@qq.com committed Jun 6, 2017
1 parent be6b748 commit 503094e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MarqueeView/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion "25.0.0"

defaultConfig {
minSdkVersion 15
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0.0"
Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Marquee-master
仿淘宝首页的淘宝头条垂直滚动<br>
滚动布局继承了是ViewFlipper,可以实现进入动画,退出动画,设置切换时间间隔。<br>
MarqueeView可用于多行或单行滚动,滚动的布局可以自定义。<br>
仿淘宝首页的淘宝头条垂直滚动
滚动布局继承了是ViewFlipper,可以实现进入动画,退出动画,设置切换时间间隔。
MarqueeView可用于多行或单行滚动,滚动的布局可以自定义。

### 效果图
<img src="/screenshots/marqueeview.gif" style="width: 30%;">
Expand Down Expand Up @@ -32,7 +32,7 @@ MarqueeView可用于多行或单行滚动,滚动的布局可以自定义。<br

**xml文件**

```
```xml
<com.sunsky.marqueeview.MarqueeView
android:id="@+id/upview1"
android:layout_width="match_parent"
Expand Down Expand Up @@ -112,6 +112,20 @@ MarqueeView可用于多行或单行滚动,滚动的布局可以自定义。<br

```

####4、重影问题可参考以下解决方案<br>
```java
@Override
public void onResume() {
super.onResume();
mallHomeMarquee.startFlipping();
}

@Override
public void onPause() {
super.onPause();
mallHomeMarquee.stopFlipping();
}
```


# Thanks
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/sunsky/marqueeviewdemo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ protected void onCreate(Bundle savedInstanceState) {
initView();
}


@Override
protected void onStart() {
super.onStart();
marqueeView1.startFlipping();
marqueeView2.startFlipping();
}

@Override
protected void onStop() {
super.onStop();
marqueeView1.stopFlipping();
marqueeView2.stopFlipping();
}

/**
* 实例化控件
*/
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eee"
android:orientation="vertical">


<com.sunsky.marqueeview.MarqueeView
android:id="@+id/upview1"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
Expand All @@ -18,8 +20,10 @@

<com.sunsky.marqueeview.MarqueeView
android:id="@+id/upview2"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_centerVertical="true"
android:padding="10dp"
app:animDuration="1000"
Expand Down

0 comments on commit 503094e

Please sign in to comment.