當前位置:首頁 » 安卓系統 » android輪播

android輪播

發布時間: 2022-02-03 22:00:24

⑴ android圖片輪播怎麼實現

正常就可以實現的吧,因為這個圖片還是比較輕松的,我都是使用的

⑵ android 頂部實現圖片輪播效果

恩恩,需要,下面那4個點也需要

⑶ android 怎麼在輪播時實現多種動畫效果,如第一張到第二張漸變,第二張到第三張旋轉

Android系統自帶的一個多頁面管理控制項,它可以實現子界面的自動切換:

首先 需要為ViewFlipper加入View

(1) 靜態導入:在layout布局文件中直接導入

(2) 動態導入:addView()方法

ViewPlipper常用方法:

setInAnimation:設置View進入屏幕時候使用的動畫

setOutAnimation:設置View退出屏幕時候使用的動畫

showNext:調用該函數來顯示ViewFlipper裡面的下一個View

showPrevious:調用該函數來顯示ViewFlipper裡面的上一個View

setFlipInterval:設置View之間切換的時間間隔

startFlipping使用上面設置的時間間隔來開始切換所有的View,切換會循環進行

stopFlipping:停止View切換

講了這么多,那麼我們今天要實現的是什麼呢?

(1) 利用ViewFlipper實現圖片的輪播

(2) 支持手勢滑動的ViewFlipper

我們需要先准備幾張圖片:把圖片放進drawable中

創建兩個動畫:在res下面新建一個folder裡面新建兩個xml:

⑷ android app 圖片輪播圖片

⑸ android 輪播列表怎麼實現

第一種:使用動畫的方法實現:
這種發放需要:兩個動畫效果,一個布局,一個主類來實現,
public class IamgeTrActivity extends Activity {

/** Called when the activity is first created. */
public ImageView imageView;
public ImageView imageView2;
public Animation animation1;
public Animation animation2;
public TextView text;
public boolean juage = true;
public int images[] = new int[] { R.drawable.icon, R.drawable.expriment,
R.drawable.changer, R.drawable.dataline, R.drawable.preffitication };
public int count = 0;
public Handler handler = new Handler();
public Runnable runnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
AnimationSet animationSet1 = new AnimationSet(true);
AnimationSet animationSet2 = new AnimationSet(true);
imageView2.setVisibility(0);
TranslateAnimation ta = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,
-1f, Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, 0f);
ta.setDuration(2000);
animationSet1.addAnimation(ta);
animationSet1.setFillAfter(true);
ta = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 1.0f,
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,
0f, Animation.RELATIVE_TO_SELF, 0f);
ta.setDuration(2000);
animationSet2.addAnimation(ta);
animationSet2.setFillAfter(true);
//iamgeView 出去 imageView2 進來
imageView.startAnimation(animationSet1);
imageView2.startAnimation(animationSet2);
imageView.setBackgroundResource(images[count % 5]);
count++;
imageView2.setBackgroundResource(images[count % 5]);
text.setText(String.valueOf(count));
if (juage)
handler.postDelayed(runnable, 6000);
Log.i(handler, handler);
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
imageView = (ImageView) findViewById(R.id.imageView);
imageView2 = (ImageView) findViewById(R.id.imageView2);
text=(TextView)findViewById(R.id.text);
text.setText(String.valueOf(count));
//將iamgeView先隱藏,然後顯示
imageView2.setVisibility(4);
handler.postDelayed(runnable, 2000);
}
public void onPause() {
juage = false;
super.onPause();
}
}

android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
android:id=@+id/rl>
android:id=@+id/imageView
android:layout_width=fill_parent
android:background=@drawable/icon
android:layout_below=@+id/rl
android:layout_height=120dp />
android:id=@+id/imageView2
android:layout_width=fill_parent
android:background=@drawable/expriment
android:layout_below=@+id/rl
android:layout_height=120dp />
android:id=@+id/text
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_below=@id/imageView/>

第二種:使用ViewFlipper實現圖片的輪播
Android系統自帶的一個多頁面管理控制項,它可以實現子界面的自動切換:
首先 需要為ViewFlipper加入View
(1) 靜態導入:在layout布局文件中直接導入
(2) 動態導入:addView()方法
ViewPlipper常用方法:
setInAnimation:設置View進入屏幕時候使用的動畫
setOutAnimation:設置View退出屏幕時候使用的動畫
showNext:調用該函數來顯示ViewFlipper裡面的下一個View
showPrevious:調用該函數來顯示ViewFlipper裡面的上一個View
setFlipInterval:設置View之間切換的時間間隔
startFlipping使用上面設置的時間間隔來開始切換所有的View,切換會循環進行
stopFlipping:停止View切換

⑹ android 中怎麼實現多圖自動輪播中間放大的效果

1,頂部輪播圖,自動輪播效果。

2,頂部的viewpager 可隨著下拉圖片有漸變大的效果。

使用方法:
1,帶輪播圖的自定義ScrollView ,在項目中的名字叫ViewPagerImageScrollView,主要是通過圖片的matrix.postScale(scale, scale, imgHeight/2, 0); 這個來進行當大圖片。

⑺ android 輪播圖高度是多少合適

輪播圖片的高度,占據手機的高度四分之一就差不多了,要看界面上的安排。也沒有具體的標准。

⑻ android怎麼給輪播加文字

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheledExecutorService;
import java.util.concurrent.TimeUnit;

import android.os.Bundle;
import android.app.Activity;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

⑼ 推薦一個關於圖片輪播的安卓app

有一個叫美圖app的軟體就可以,當然現在很多視頻製作軟體都可以。

熱點內容
i西安編程 發布:2024-04-25 16:55:35 瀏覽:263
核磁看壓縮 發布:2024-04-25 16:37:22 瀏覽:432
訪問不上光貓 發布:2024-04-25 16:13:44 瀏覽:319
部隊電腦配置有哪些 發布:2024-04-25 16:13:43 瀏覽:970
霍曼密碼鎖什麼價位 發布:2024-04-25 16:08:01 瀏覽:750
ftp雙機熱備 發布:2024-04-25 16:03:48 瀏覽:360
我的世界伺服器限制模組 發布:2024-04-25 15:55:32 瀏覽:888
平板電腦能連接雲伺服器嗎 發布:2024-04-25 15:54:05 瀏覽:937
多看怎麼上傳雲 發布:2024-04-25 15:45:31 瀏覽:39
山東ftp 發布:2024-04-25 15:44:46 瀏覽:261