当前位置:首页 » 安卓系统 » wheelviewandroid

wheelviewandroid

发布时间: 2022-07-15 06:22:38

① android wheelview 怎么自定义样式

*
* @param index the item index
* @return the wheel item text or null
*/
public String getItem(int index);

/**
* Gets maximum item length. It is used to determine the wheel width.
* If -1 is returned there will be used the default wheel width.
*
* @return the maximum item length or -1
*/
public int getMaximumLength();
}

② 谁有横向的wheelview-Android开发问答

这是安卓自带的日期选择控件如果你想自己实现的话,有个开源的框架,叫wheelView项目地址/wangjiegulu/WheelView实现的效果就是这样的

③ android 怎样用HorizontalScrollView左右弹性的菜单

{

SlidingMenumSlidingMenu;

@Override

protectedvoidonCreate(Bundlearg0){

super.onCreate(arg0);

setContentView(R.layout.main);

DisplayMetricsdm=newDisplayMetrics();

getWindowManager().getDefaultDisplay().getMetrics(dm);

mSlidingMenu=(SlidingMenu)findViewById(R.id.slidingMenu);

mSlidingMenu.setAlignScreenWidth((dm.widthPixels/5)*2);

ViewleftView=getLayoutInflater().inflate(R.layout.left_menu,null);

ViewrightView=getLayoutInflater().inflate(R.layout.right_menu,null);

ViewcenterView=getLayoutInflater().inflate(R.layout.center,null);

mSlidingMenu.setLeftView(leftView);

mSlidingMenu.setRightView(rightView);

mSlidingMenu.setCenterView(centerView);

ButtonshowLeftMenu=(Button)centerView.findViewById(R.id.center_left_btn);

showLeftMenu.setOnClickListener(this);

ButtonshowRightMenu=(Button)centerView.findViewById(R.id.center_right_btn);

showRightMenu.setOnClickListener(this);

}

@Override

publicvoidonClick(Viewv){

//TODOAuto-generatedmethodstub

switch(v.getId()){

caseR.id.center_left_btn:

mSlidingMenu.showLeftView();

break;

caseR.id.center_right_btn:

mSlidingMenu.showRightView();

break;

default:

break;

}

}

}

④ 关于Android wheelview控件的错乱问题

setVisibleItems(int count)

把count设成单数就可以了

⑤ android wheelview为什么只能展示一个

将布局文件转换成视图,再从中获取那个TextView,再设置监听,LayoutInflaterinflater=LayoutInflater.from(this);Viewview=inflater.inflate(R.layout.xxxxx,null);TextViewtv=(TextView)view.findViewById(R.id.tv_xx);tv.setOnXXXXXXX

⑥ android wheelview样式怎么改

android wheelview样式的话,可以写好xml,然后倒入:
Demo
Use the WheelView as a View, java and XML are both supported.
Java:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main)

WheelView wheelView = (WheelView) findViewById(R.id.wheelview);
wheelView.setWheelAdapter(new ArrayWheelAdapter(this)); // 文本数据源
wheelView.setSkin(WheelView.Skin.Common); // common 皮肤
wheelView.setWheelData( ?); // 数据集合

}
}

XML:
<com.wx.wheelview.widget.WheelView
android:id="@+id/wheelview"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

⑦ 请教一个关于android wheel的问题,求高手

Activity代码:::package com.winjing.meetingcontroller.ui;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

import kankan.wheel.R;
import kankan.wheel.widget.WheelView;
import kankan.wheel.widget.adapters.AbstractWheelTextAdapter;
import kankan.wheel.widget.adapters.NumericWheelAdapter;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;

public class CreatNewMeetingActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_creat_new_meeting);

Calendar cal = Calendar.getInstance(Locale.CHINA);
final WheelView wheel_hour = (WheelView) findViewById(R.id.hour);
NumericWheelAdapter adapter_hour = new NumericWheelAdapter(this, 0, 23,
"%02d");
adapter_hour.setItemResource(R.layout.wheel_text_item);
adapter_hour.setItemTextResource(R.id.text);
wheel_hour.setViewAdapter(adapter_hour);
// 循环滚动
wheel_hour.setCyclic(true);

final WheelView wheel_minute = (WheelView) findViewById(R.id.minute);
NumericWheelAdapter adapter_minute = new NumericWheelAdapter(this, 0,
59, "%02d");
adapter_minute.setItemResource(R.layout.wheel_text_item);
adapter_minute.setItemTextResource(R.id.text);
wheel_minute.setViewAdapter(adapter_minute);
wheel_minute.setCyclic(true);

// ////////////////////////////

final WheelView wheel_meeting_hour = (WheelView) findViewById(R.id.meeting_hour);
NumericWheelAdapter adapter_meeting_hour = new NumericWheelAdapter(
this, 0, 23, "%02d");
adapter_meeting_hour.setItemResource(R.layout.wheel_text_item);
adapter_meeting_hour.setItemTextResource(R.id.text);
wheel_meeting_hour.setViewAdapter(adapter_meeting_hour);
wheel_meeting_hour.setCyclic(true);

final WheelView wheel_meeting_minute = (WheelView) findViewById(R.id.meeting_minute);
NumericWheelAdapter adapter_meeting_minute = new NumericWheelAdapter(
this, 0, 59, "%02d");
adapter_meeting_minute.setItemResource(R.layout.wheel_text_item);
adapter_meeting_minute.setItemTextResource(R.id.text);
wheel_meeting_minute.setViewAdapter(adapter_meeting_minute);
wheel_meeting_minute.setCyclic(true);

// ////////////////////////////////
Calendar calendar = Calendar.getInstance(Locale.CHINA);
wheel_hour.setCurrentItem(calendar.get(Calendar.HOUR));
wheel_minute.setCurrentItem(calendar.get(Calendar.MINUTE));

final WheelView wheel_day = (WheelView) findViewById(R.id.day);
wheel_day.setViewAdapter(new DayAdapter(this, calendar));
// wheel_day.setCurrentItem(calendar.get(Calendar.DAY_OF_YEAR), false);
wheel_day.setCyclic(true);

}

private class DayAdapter extends AbstractWheelTextAdapter {

// 向下的天数
private final int daysCount = 20;
private Calendar calendar;

/**
* Constructor
*/
protected DayAdapter(Context context, Calendar calendar) {
super(context, R.layout.time2_day, NO_RESOURCE);
this.calendar = calendar;

setItemTextResource(R.id.time2_monthday);
}

@Override
public View getItem(int index, View cachedView, ViewGroup parent) {
// int day = -daysCount / 2 + index;
int day = -daysCount / 2 + index;
int sum = day + index;
Log.v("getItem", "day = " + day + "; index = " + index
+ "; day + index = " + (day + index));
Calendar newCalendar = (Calendar) calendar.clone();

newCalendar.roll(Calendar.DAY_OF_YEAR, day);

View view = super.getItem(index, cachedView, parent);

if (day == 0) {

TextView weekday = (TextView) view
.findViewById(R.id.time2_weekday);
weekday.setText("");

TextView monthday = (TextView) view
.findViewById(R.id.time2_monthday);
monthday.setText("今天");
monthday.setTextColor(0xFF0000F0);
} else {
if (day > 0) {
TextView weekday = (TextView) view
.findViewById(R.id.time2_weekday);
DateFormat format_week = new SimpleDateFormat("EEE");
weekday.setText(format_week.format(newCalendar.getTime()));

TextView monthday = (TextView) view
.findViewById(R.id.time2_monthday);
DateFormat format_month = new SimpleDateFormat("MMM d");
monthday.setText(format_month.format(newCalendar.getTime()));
monthday.setTextColor(0xFF111111);
} else {

TextView weekday_move = (TextView) view
.findViewById(R.id.time2_weekday);
weekday_move.setText("##");
}

}
return view;
}

@Override
public int getItemsCount() {
return daysCount + 1;
}

@Override
protected CharSequence getItemText(int index) {
return "";
}
}
}

⑧ android 怎么得到wheelview的值

TextView text=(TextView)findViewById(R.id.textview01); String s=text.getText().toString().trim(); Intent myIntentDial=new Intent("android.intent.action.CALL",Uri.parse("tel:"+s)); startActivity(myIntentDial);

热点内容
wamp数据库 发布:2025-01-25 01:36:02 浏览:794
安卓通知栏怎么显示秒表 发布:2025-01-25 01:32:47 浏览:757
apk反编译入门 发布:2025-01-25 01:26:43 浏览:472
英雄联盟在哪投诉脚本 发布:2025-01-25 01:26:43 浏览:314
php在线统计 发布:2025-01-25 01:26:42 浏览:65
手机加密室 发布:2025-01-25 01:25:57 浏览:219
搭建excel服务器 发布:2025-01-25 01:25:19 浏览:1000
双系统win7和linux 发布:2025-01-25 01:25:19 浏览:606
为什么苹果手机摄像比安卓好 发布:2025-01-25 01:06:48 浏览:787
linux查看系统多少位 发布:2025-01-25 01:04:31 浏览:121