旋转木马布局效果
gradlecompile 'com.dalong:carrousellayout:1.0.0'
or Maven
com.dalong
carrousellayout
1.0.0
pom
xml:
android:id="@+id/carrousel"
app:rotateDirection="anticlockwise"
app:r="200dp"
app:rotationTime="3000"
android:gravity="center"
android:layout_marginBottom="180dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:src="@mipmap/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:src="@mipmap/image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
...
java:CarrouselLayout carrousel= (CarrouselLayout) findViewById(R.id.carrousel);
carrousel.setR(width/3)//设置R的大小
.setAutoRotation(false)//是否自动切换
.setAutoRotationTime(1500);//自动切换的时间 单位毫秒