亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

項(xiàng)目中ViewFlipper 的使用

系統(tǒng) 1787 0

? 效果展示



項(xiàng)目中ViewFlipper 的使用
?
點(diǎn)擊右下角的btn

項(xiàng)目中ViewFlipper 的使用
?
同一個(gè)activity 里切換到另一個(gè)界面


具體實(shí)現(xiàn):

主要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) {
                              //跳到下一個(gè)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 {
                              //跳到下一個(gè)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">
            <!-- 第一個(gè)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>


            <!-- 第二個(gè)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="這是一座房子,面朝大海,春暖花開(kāi)"
                        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>
    
?

項(xiàng)目中ViewFlipper 的使用


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

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

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 日韩欧美一区二区精品久久 | 国产成人小视频在线观看 | 免费观看欧美精品成人毛片 | 最新99国产成人精品视频免费 | 国产亚洲精品国产福利在线观看 | 精品国产综合区久久久久久 | 婷婷婷色 | 色偷偷要色偷偷网站视频在线 | 中文字幕欧美日韩高清 | 精品图区 | 夜夜躁日日躁狠狠 | 国产最新在线视频 | 久久机热一这里只精品 | 午夜私人影院粉色视频我要 | 欧美日韩亚洲综合久久久 | 日韩视频不卡 | 美女被草视频 | 日本国产亚洲 | 天天拍夜夜添久久精品中文 | 韩国色三级伦不卡高清在线观看 | 免费视频亚洲 | 中文字幕一区二区三区免费看 | 在线欧美v日韩v国产精品v | 欧美国产日韩在线 | 一级一级女人18毛片 | 情趣色视频网站 | www精品久久 | 欧美日韩一区二区亚洲 | 九九视频国产免 | 日韩在线免费视频 | 国产成人精品视频免费 | 亚洲精品国产一区二区三区四区 | 国产69精品久久久久99 | 99免费视频观看 | 91免费国产在线观看尤物 | 国产午夜永久福利视频在线观看 | 手机看片久久 | 精品亚洲无人区一区二区 | 国产精品亚洲欧美日韩区 | www.国产.com| 久久免费观看国产精品 |