http://www.2cto.com/kf/201205/131771.html
viewfipper继承关系:
用法:
http://blog.csdn.net/wdaming1986/article/details/6766058
- this.flipper.setInAnimation(AnimationUtils.loadAnimation(this,
- R.anim.push_left_in));
- this.flipper.setOutAnimation(AnimationUtils.loadAnimation(this,
- R.anim.push_left_out));
- if (count < 3) {
- this.flipper.showNext();
- count++;
- }
- this.flipper.setInAnimation(AnimationUtils.loadAnimation(this,
- R.anim.push_right_in));
- this.flipper.setOutAnimation(AnimationUtils.loadAnimation(this,
- R.anim.push_right_out));
- if (count > 1) {
- this.flipper.showPrevious();
- count--;
- }
- <ViewFlipper android:id="@+id/view_flipper"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- android:persistentDrawingCache="animation" android:flipInterval="1000"
- android:inAnimation="@anim/push_left_in" android:outAnimation="@anim/push_left_out">
- <LinearLayout android:orientation="horizontal"
- android:layout_width="fill_parent" android:layout_height="fill_parent">
- <ImageView android:id="@+id/view_bg1" android:src="@drawable/bg1"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- >
- </ImageView>
- </LinearLayout>
- <LinearLayout android:orientation="horizontal"
- android:layout_width="fill_parent" android:layout_height="fill_parent">
- <ImageView android:id="@+id/view_bg2" android:src="@drawable/bg2"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- >
- </ImageView>
- </LinearLayout>
- <LinearLayout android:orientation="horizontal"
- android:layout_width="fill_parent" android:layout_height="fill_parent">
- <ImageView android:id="@+id/view_bg3" android:src="@drawable/bg3"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- >
- </ImageView>
- </LinearLayout>
- </ViewFlipper>
anim动画布局文件:
1、push_left_in.xml布局文件:
- <span style="font-size:13px;"><?xml version="1.0" encoding="utf-8"?>
- <set xmlns:android="http://schemas.android.com/apk/res/android">
- <translate android:fromXDelta="100%p" android:toXDelta="0"
- android:duration="500" />
- <alpha android:fromAlpha="0.1" android:toAlpha="1.0"
- android:duration="500" />
- </set></span>
- <strong>
- </strong>
2、push_left_out.xml布局文件
- <?xml version="1.0" encoding="utf-8"?>
- <set xmlns:android="http://schemas.android.com/apk/res/android">
- <translate android:fromXDelta="0" android:toXDelta="-100%p"
- android:duration="500" />
- <alpha android:fromAlpha="1.0" android:toAlpha="0.1"
- android:duration="500" />
- </set>
ios:UITabBarControllert添加图标
UIViewController *ctrl2 = [[UIViewController alloc] init];
ctrl2.view.backgroundColor = [UIColor yellowColor];
ctrl2.title = @"#2";
UIViewController本身有个tabBarItem变量,如果不设置,没有图标,需要图标可以这样设置:
HomeViewController *ctrl1 = [[HomeViewController alloc] init];
UITabBarItem *item = [[UITab
写一个自定义的ViewController方便控制,分开来写是一个不错的开发思路,ios果然人性化。