android滑动效果ViewFlow(开源库)例子

MrLee2015-4-23 2163

1.下载ViewFlow的源码,然后将类ViewFlow放在自己的工程的src的某个包下。2.下载的源码里有2个工程view flow,viewflow-example。将view flow工程里的attr本文例子:viewflow

d72302fe-d05f-300a-84c7-f622adf21102

b4fecbda-1daa-3f28-85dc-a4bf20cccd69


第1种样式例子:用法:
public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTitle(R.string.circle_title);
		setContentView(R.layout.circle_layout);
		viewFlow = (ViewFlow) findViewById(R.id.viewflow);
		viewFlow.setAdapter(new ImageAdapter(this));
		CircleFlowIndicator indic = (CircleFlowIndicator) findViewById(R.id.viewflowindic);
		viewFlow.setFlowIndicator(indic);
		
	}
xml布局


	
		
	
	

第2种样式例子:
public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTitle(R.string.title_title);
		setContentView(R.layout.title_layout);
		viewFlow = (ViewFlow) findViewById(R.id.viewflow);
		AndroidVersionAdapter adapter = new AndroidVersionAdapter(this);
		viewFlow.setAdapter(adapter);
		TitleFlowIndicator indicator = (TitleFlowIndicator) findViewById(R.id.viewflowindic);
		indicator.setTitleProvider(adapter);
		viewFlow.setFlowIndicator(indicator);
		
	}
xml 布局文件


	
		
	
	
 
自定义属性也一起贴上,方便参考:



    
        
    
    
        
        
        
        
    
        
        
        
        
        
        
        
        

https://github.com/pakerfeldt/android-viewflow

本文链接:https://www.it72.com/2285.htm

推荐阅读
最新回复 (0)
    返回