欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

項目中ViewFlipper 的使用

系統 1878 0

? 效果展示



項目中ViewFlipper 的使用
?
點擊右下角的btn

項目中ViewFlipper 的使用
?
同一個activity 里切換到另一個界面


具體實現:

主要java代碼
        public class FlipperActivity extends Activity{
      private ViewFlipper flipper = null;
      private ImageButton button = null;
      private boolean flag=false;
      
      @Override
      public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.flipper);
            
            flipper = (ViewFlipper) findViewById(R.id.flipper);
            button = (ImageButton) findViewById(R.id.back);
            
            button.setOnClickListener(new View.OnClickListener() {


                  public void onClick(View arg0) {


                        if (flag) {
                              //跳到下一個flipper
                              flipper.showNext();
                              //flipper切換的效果
                              new AnimationUtils();
                              flipper.setInAnimation(AnimationUtils.loadAnimation(
                                          FlipperActivity.this, R.anim.push_left_in));
                              new AnimationUtils();
                              flipper.setOutAnimation(AnimationUtils.loadAnimation(
                                          FlipperActivity.this, R.anim.push_left_out));
                              button
                                          .setBackgroundResource(R.drawable.pdp_info_button);
                        } else {
                              //跳到下一個flipper
                              flipper.showNext();
                              //flipper切換的效果
                              new AnimationUtils();
                              flipper.setInAnimation(AnimationUtils.loadAnimation(
                                          FlipperActivity.this, R.anim.push_right_in));
                              new AnimationUtils();
                              flipper.setOutAnimation(AnimationUtils.loadAnimation(
                                          FlipperActivity.this, R.anim.push_right_out));
                              button
                                          .setBackgroundResource(R.drawable.pdp_info_button_back);
                        }
                        flag = !flag;


                  }


            });
      }
}



      
?
XML文件

      <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@color/whitetextcolor"
    >
   
<ViewFlipper android:id="@+id/flipper"
            android:layout_height="120dp" android:layout_width="wrap_content">
            <!-- 第一個flipper-->
            <RelativeLayout android:layout_height="wrap_content"
                  android:layout_width="fill_parent" android:id="@+id/relativeLayout1">
                  <ImageView android:id="@+id/imageView1"       android:src="@drawable/md_hometabicon"
                        android:layout_width="wrap_content" android:layout_height="wrap_content"
                        android:layout_marginLeft="40dip" android:layout_marginTop="80dip" />
                  <TextView android:id="@+id/price" android:layout_width="wrap_content"
                        android:layout_height="wrap_content" android:text="$5.00"
                        android:textColor="@color/yellowtextcolor"
                        android:layout_marginLeft="200dip" android:layout_marginTop="80dip" />
            </RelativeLayout>


            <!-- 第二個flipper-->
            <RelativeLayout android:layout_height="wrap_content"
                  android:layout_width="fill_parent" android:id="@+id/relativeLayout1">


                  <TextView android:id="@+id/price" android:layout_width="wrap_content"
                        android:layout_height="wrap_content" android:text="這是一座房子,面朝大海,春暖花開"
                        android:layout_marginLeft="40dip" android:layout_marginTop="80dip"
                        android:textColor="@color/yellowtextcolor" />
            </RelativeLayout>
      </ViewFlipper>
   <ImageButton android:id="@+id/back" android:background="@drawable/pdp_info_button"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_gravity="bottom|right" />
</LinearLayout>
    
?

項目中ViewFlipper 的使用


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日韩欧美精品综合一区二区三区 | 亚洲精品中文字幕大岛优香 | 五月伊人网 | 久久经典视频 | 第三级视频在线观看 | 久久久久久国产视频 | 久久精品网 | aaa一级毛片免费 | 国产亚洲精品久久久极品美女 | 91精品国产免费久久 | 日本三级韩国三级香港三级a级 | 日本v片做爰免费视频网站 国产精品v欧美精品v日韩精品 | 欧美日日日 | 欧美日韩一区二区三区在线观看 | 精品一区二区三区不卡 | 午夜插插| 天天爆操 | 奇米影视第四色在线 | 日本VA在线视频播放 | 亚洲不卡在线 | 日韩免费视频播播 | 欧美电影网站在线观看影片 | 久久久久免费 | 91精品啪国产在线观看免费牛牛 | 国产一区二区在线免费观看 | 亚洲精品一区中文字幕乱码 | 亚洲在线观看 | 亚洲国产午夜精品乱码 | 很黄很污的网站 | 特黄特色的大片观看免费视频 | 伦一区二区三区中文字幕v亚洲 | 国产精品久久久久久久久免费 | 午夜影视 | 欧美日韩黄 | 色综合网亚洲精品久久久 | 天天成人综合网 | 国产成人免费无庶挡视频 | 国产日韩亚洲不卡高清在线观看 | 国内视频精品 | 久久久久国产成人精品亚洲午夜 | 中文字幕一区二区在线观看 |