- 浏览: 626942 次
- 性别:
- 来自: 济南
文章分类
- 全部博客 (164)
- android(基础) (81)
- android(进阶) (2)
- android(底层) (7)
- android(面试) (0)
- android(多媒体) (1)
- android(组件学习) (4)
- android(网络相关) (0)
- android(动画) (1)
- android(数据库) (2)
- android(UI样式) (3)
- android(xml) (0)
- android(调试) (14)
- android(环境搭建) (7)
- android(api) (1)
- C++ (1)
- C (0)
- JavaSE (2)
- Objective-c (1)
- JavaScript (0)
- 设计模式 (0)
- eclipse (3)
- javaee (4)
- 其它 (5)
- linux (18)
- Oracle (1)
- mysql (1)
- 嵌入式linux (1)
- 版本控制工具 (3)
- web前端 (1)
- python (1)
最新评论
-
chungehenyy:
android颜色对应的xml配置值,颜色表 -
u011467537:
...
android中用Spannable在TextView中设置超链接、颜色、字体 -
SurpriseLee:
不能更赞了!
android颜色对应的xml配置值,颜色表 -
u012094586:
这个代码是不是不全呀,能不能提供完整版的给予参考呢?xiexi ...
Android VideoView如何播放RTSP的流 -
luechenying:
顶上天!!!!!!!!!!!!!!!!!!
android颜色对应的xml配置值,颜色表
最近都没有时间来更新我的博客,主要是在项目中遇到一些比较棘手的问题需要解决,今天我就把我解决的难题写了个Demo出来与大家一起分享,最终达到火种通讯录联系人界面的效果。
在这次代码编写当中,我主要用到了WindowManager来显示友好提示
在对数组进行排序的时候,我们可以用 Arrays.sort()方法轻松实现按字母顺序排序。
另外在实现点击字母后让ListView滚动到以该字母开头的相应位置效果时,我们要用到如下方法:
一个是通过public static int binarySearch(Object[] a,Object key) 方法来获得该字母出现的Item在ListView中的位置position,
另一个就是 list.setSelection(localPosition); 来让List指向对应位置的Item。
当你对这些方法都有所了解了以后,下面我们开始设计我们的Demo。
我们先建立一个名为ContactsDemo的工程,然后就是代码部分了:
第一步,在res/layout的main.xml中我们来设置Activity中显示ListView上下层显示的效果,其实就是一个相对布局。
第二步,我们在layout中建一个list_popup_char_hint.xml,这是用来通过WindowManager显示友好提示的。
第三步,是list_item.xml用来设置ListView中Items的布局。
第四步,是一个textview.xml用来显示右边覆盖在ListView上的ListView的Items
第五步,我们建一个名为ContactsDemo的类,然后就是实现功能的代码了,里面有非常详尽的注释,大家慢慢看吧。
在这次代码编写当中,我主要用到了WindowManager来显示友好提示
在对数组进行排序的时候,我们可以用 Arrays.sort()方法轻松实现按字母顺序排序。
另外在实现点击字母后让ListView滚动到以该字母开头的相应位置效果时,我们要用到如下方法:
一个是通过public static int binarySearch(Object[] a,Object key) 方法来获得该字母出现的Item在ListView中的位置position,
另一个就是 list.setSelection(localPosition); 来让List指向对应位置的Item。
当你对这些方法都有所了解了以后,下面我们开始设计我们的Demo。
我们先建立一个名为ContactsDemo的工程,然后就是代码部分了:
第一步,在res/layout的main.xml中我们来设置Activity中显示ListView上下层显示的效果,其实就是一个相对布局。
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <ListView android:id="@+id/listview" android:layout_width="30dip" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:background="@null" /> </RelativeLayout>
第二步,我们在layout中建一个list_popup_char_hint.xml,这是用来通过WindowManager显示友好提示的。
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:textSize="70sp" android:textColor="#ffffffff" android:minWidth="70dip" android:maxWidth="70dip" android:padding="10dip" android:gravity="center" />
第三步,是list_item.xml用来设置ListView中Items的布局。
<?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="fill_parent"> <TextView android:id="@+id/text_first_char_hint" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="20dip" android:paddingLeft="10dip" android:background="@drawable/background" android:visibility="gone"> </TextView> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/order" android:layout_width="wrap_content" android:layout_height="60dip" android:textSize="15dip" android:layout_gravity="left" android:layout_weight="2"/> <TextView android:id="@+id/content" android:gravity="center" android:layout_width="wrap_content" android:layout_height="60dip" android:textSize="15dip" android:layout_weight="2"/> </LinearLayout > </LinearLayout >
第四步,是一个textview.xml用来显示右边覆盖在ListView上的ListView的Items
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textSize="20dip"> </TextView>
第五步,我们建一个名为ContactsDemo的类,然后就是实现功能的代码了,里面有非常详尽的注释,大家慢慢看吧。
package com.ContactsDemo; import java.util.ArrayList; import java.util.Arrays; import android.app.Activity; import android.content.Context; import android.graphics.PixelFormat; import android.os.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.AbsListView.OnScrollListener; import android.widget.AdapterView.OnItemClickListener; /** * @author Mr.罗 * */ public class ContactsDemo extends Activity implements OnItemClickListener,OnScrollListener{ /** Called when the activity is first created. */ private MyListAdapter adapter; private ArrayList<String> webNameArr; private WindowManager windowManager; private TextView txtOverlay; //用来放在WindowManager中显示提示字符 private Handler handler; private DisapearThread disapearThread; private int scrollState; //滚动的状态 private ListView list,listview; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtOverlay = (TextView) LayoutInflater.from(this).inflate(R.layout.list_popup_char_hint, null); // 默认设置为不可见。 txtOverlay.setVisibility(View.INVISIBLE); //设置WindowManager WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, //设置为无焦点状态 WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, //半透明效果 PixelFormat.TRANSLUCENT); windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE); windowManager.addView(txtOverlay, lp); handler = new Handler(); disapearThread = new DisapearThread(); Arrays.sort(stringArr,String.CASE_INSENSITIVE_ORDER); //大小写不敏感 webNameArr = new ArrayList<String>(); for (int i = 0; i < stringArr.length; i++) { webNameArr.add(stringArr[i]); } list = (ListView)this.findViewById(R.id.list); //联系人ListView listview = (ListView)this.findViewById(R.id.listview); //拼音查询ListView adapter = new MyListAdapter(this); list.setAdapter(adapter);//将数据适配器与Activity进行绑定 list.setOnScrollListener(this); ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this,R.layout.textview,py); listview.setAdapter(adapter1); listview.setDivider(null); listview.setOnItemClickListener(this); } private class DisapearThread implements Runnable { public void run() { // 避免在1.5s内,用户再次拖动时提示框又执行隐藏命令。 if (scrollState == ListView.OnScrollListener.SCROLL_STATE_IDLE) { txtOverlay.setVisibility(View.INVISIBLE); } } } //继承BaseAdapter来设置ListView每行的内容 public final class ViewHolder { public TextView firstCharHintTextView; public TextView orderTextView; public TextView nameTextView; public TextView urlTextView; public ImageView imgView; } private class MyListAdapter extends BaseAdapter { private LayoutInflater inflater; public MyListAdapter(Context context) { this.inflater = LayoutInflater.from(context); } public int getCount() { return webNameArr.size(); } public Object getItem(int position) { return webNameArr.get(position); } public long getItemId(int position) { return position; } public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if (convertView == null) { convertView = inflater.inflate(R.layout.list_item, null); holder = new ViewHolder(); holder.firstCharHintTextView = (TextView) convertView.findViewById(R.id.text_first_char_hint); holder.orderTextView = (TextView) convertView.findViewById(R.id.order); holder.nameTextView = (TextView) convertView.findViewById(R.id.content); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.orderTextView.setText(String.valueOf(position + 1) + "."); holder.nameTextView.setText(webNameArr.get(position)); int idx = position - 1; //判断前后Item是否匹配,如果不匹配则设置并显示,匹配则取消 char previewChar = idx >= 0 ? stringArr[idx].charAt(0) : ' '; char currentChar = stringArr[position].charAt(0); //将小写字符转换为大写字符 char newPreviewChar = Character.toUpperCase(previewChar); char newCurrentChar = Character.toUpperCase(currentChar); if (newCurrentChar != newPreviewChar) { holder.firstCharHintTextView.setVisibility(View.VISIBLE); holder.firstCharHintTextView.setText(String.valueOf(newCurrentChar)); } else { // 此段代码不可缺:实例化一个CurrentView后,会被多次赋值并且只有最后一次赋值的position是正确 holder.firstCharHintTextView.setVisibility(View.GONE); } return convertView; } } public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { // 以中间的ListItem为标准项来显示。 txtOverlay.setText(String.valueOf(stringArr[firstVisibleItem + (visibleItemCount >> 1)].charAt(0)).toUpperCase()); } public void onScrollStateChanged(AbsListView view, int scrollState) { this.scrollState = scrollState; if (scrollState == ListView.OnScrollListener.SCROLL_STATE_IDLE) { handler.removeCallbacks(disapearThread); // 提示延迟1.5s再消失 handler.postDelayed(disapearThread, 1500); } else { txtOverlay.setVisibility(View.VISIBLE); } } public void onItemClick(AdapterView<?> parent, View view, int position, long id) { String s = ((TextView)view).getText().toString(); txtOverlay.setText(s); txtOverlay.setVisibility(View.VISIBLE); handler.removeCallbacks(disapearThread); // 提示延迟1.5s再消失 handler.postDelayed(disapearThread, 1500); int localPosition = binSearch(stringArr,s); //接收返回值 if(localPosition!=-1){ txtOverlay.setVisibility(View.INVISIBLE); //防止点击出现的txtOverlay与滚动出现的txtOverlay冲突 list.setSelection(localPosition); //让List指向对应位置的Item } } //将选中的py与stringArr的首字符进行匹配并返回对应字符串在数组中的位置 public static int binSearch(String[] string , String s ){ for(int i=0;i<string.length;i++){ if(s.equalsIgnoreCase(""+string[i].charAt(0))){ //不区分大小写 return i; } } return -1; } public void onDestroy() { super.onDestroy(); // 将txtOverlay删除。 txtOverlay.setVisibility(View.INVISIBLE); windowManager.removeView(txtOverlay); } /**在这里我们将字符串打乱,且含有大小写开头不等*/ private String[] stringArr = { "abbaye de Belloc", "abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi", "Acorn", "Adelost", "Affidelice au Chablis", "afuega'l Pitu", "Airag", "Airedale", "Aisy Cendre", "Allgauer Emmentaler", "Alverca", "ambert", "american Cheese", "Ami du Chambertin", "Anejo Enchilado", "brebis du Lochois", "brebis du Puyfaucon", "aresse Bleu", "Ardi Gasna", "Ardrahan", "Armenian String", "Aromes au Gene de Marc", "asadero", "asiago", "Aubisque Pyrenees", "Autun", "Avaxtskyr", "Baby Swiss", "Babybel", "Baguette Laonnaise", "Bakers", "Baladi", "Balaton", "bandal", "Banon", "Barry's Bay Cheddar", "Basing", "Basket Cheese", "Bath Cheese", "Bavarian Bergkase", "Baylough", "Beaufort", "Beauvoorde", "Beenleigh Blue", "Beer Cheese", "Bel Paese", "Bergader", "Bergere Bleue", "Berkswell", "Beyaz Peynir", "Bierkase", "Bishop Kennedy", "Blarney", "Bleu d'Auvergne", "Bleu de Gex", "Bleu de Laqueuille", "Bleu de Septmoncel", "Bleu Des Causses", "Blue", "Blue Castello", "Blue Rathgore", "Blue Vein (Australian)", "Blue Vein Cheeses", "Bocconcini", "Bocconcini (Australian)", "Boeren Leidenkaas", "Bonchester", "Bosworth", "Bougon", "Boule Du Roves", "Boulette d'Avesnes", "Boursault", "Boursin", "eouyssou", "Bra", "Braudostur", "Breakfast Cheese", "Brebis du Lavort", "Allgauer Emmentaler", "Alverca", "Ambert", "Brick", "Brie", "Brie de Meaux", "Brie de Melun", "Brillat-Savarin", "Brin", "Brin d' Amour", "Brin d'Amour", "Brinza (Burduf Brinza)", "Briquette de Brebis", "driquette du Forez", "Broccio", "Broccio Demi-Affine", "Brousse du Rove", "Bruder Basil", "Brusselae Kaas (Fromage de Bruxelles)", "Bryndza", "Buchette d'Anjou", "Buffalo", "Burgos", "Butte", "Butterkase", "Button (Innes)", "Buxton Blue", "Cabecou", "Caboc", "Cabrales", "Cachaille", "Caciocavallo", "Caciotta", "Caerphilly", "Cairnsmore", "Calenzana", "Cambazola", "Camembert de Normandie", "Canadian Cheddar", "Canestrato", "Cantal", "Caprice des Dieux", "Capricorn Goat", "Capriole Banon", "Carre de l'Est", "Casciotta di Urbino", "Cashel Blue", "Castellano", "Castelleno", "Castelmagno", "Castelo Branco", "Castigliano", "Cathelain", "Celtic Promise", "Cendre d'Olivet", "Cerney", "Chabichou", "Chabichou du Poitou", "Chabis de Gatine", "Chaource", "Charolais", "Chaumes", "Cheddar", "Cheddar Clothbound", "Cheshire", "Chevres", "Chevrotin des Aravis", "Derby", "Dessertnyj Belyj", "Devon Blue", "Devon Garland", "Coeur de Chevre", "Colby", "Cold Pack", "Comte", "Coolea", "Cooleney", "Coquetdale", "Corleggy", "Cornish Pepper", "Cotherstone", "Cotija", "Cottage Cheese", "Cottage Cheese (Australian)", "Cougar Gold", "Coulommiers", "Coverdale", "Crayeux de Roncq", "Cream Cheese", "Cream Havarti", "Crema Agria", "Crema Mexicana", "Creme Fraiche", "Crescenza", "Croghan", "Crottin de Chavignol", "frottin du Chavignol", "Crowdie", "Crowley", "Cuajada", "Curd", "Cure Nantais", "Curworthy", "Cwmtawe Pecorino", "Cypress Grove Chevre", "Danablu (Danish Blue)", "Danbo", "Danish Fontina", "Daralagjazsky", "Dauphin", "Delice des Fiouves", "Denhany Dorset Drum", "Derby", "Dessertnyj Belyj", "Devon Blue", "Devon Garland", "Dolcelatte", "Doolin", "Doppelrhamstufel", "Dorset Blue Vinney", "Double Gloucester", "Double Worcester", "Dreux a la Feuille", "Dry Jack", "Duddleswell", "Dunbarra", "Dunlop", "Dunsyre Blue", "Duroblando", "Durrus", "Dutch Mimolette (Commissiekaas)", "Edam", "Edelpilz", "Emental Grand Cru", "Emlett", "Emmental", "Epoisses de Bourgogne", "Esbareich", "Esrom", "Etorki", "Evansdale Farmhouse Brie", "Evora De L'Alentejo", "Exmoor Blue", "Explorateur", "Feta", "Feta (Australian)", "Figue", "Filetta", "Fin-de-Siecle", "Finlandia Swiss", "Finn", "Fiore Sardo", "Fleur du Maquis", "Flor de Guia", "Flower Marie", "Folded", "Folded cheese with mint", "Fondant de Brebis", "Fontainebleau", "Fontal", "Fontina Val d'Aosta", "Formaggio di capra", "Fougerus", "Four Herb Gouda", "Fourme d' Ambert", "Fourme de Haute Loire", "Fourme de Montbrison", "Fresh Jack", "Fresh Mozzarella", "Fresh Ricotta", "Fresh Truffles", "Fribourgeois", "Friesekaas", "Friesian", "Friesla", "Frinault", "Fromage a Raclette", "Fromage Corse", "Fromage de Montagne de Savoie", "Fromage Frais", "Fruit Cream Cheese", "Frying Cheese", "Fynbo", "Gabriel", "Galette du Paludier", "kalette Lyonnaise", "Galloway Goat's Milk Gems", "Gammelost", "Gaperon a l'Ail", "Garrotxa", "Gastanberra", "Geitost", "Gippsland Blue", "Gjetost", "Gloucester", "Golden Cross", "Gorgonzola", "Gornyaltajski", "Gospel Green", "Gouda", "Goutu", "Gowrie", "Grabetto", "Graddost", "Grafton Village Cheddar", "Grana", "Grana Padano", "Grand Vatel", "Grataron d' Areches", "Gratte-Paille", "Graviera", "Greuilh", "Greve", "Gris de Lille", "Gruyere", "Gubbeen", "Guerbigny", "Halloumi", "Halloumy (Australian)", "Haloumi-Style Cheese", "Harbourne Blue", "Havarti", "Heidi Gruyere", "Hereford Hop", "Herrgardsost", "Herriot Farmhouse", "Herve", "Hipi Iti", "Hubbardston Blue Cow", "Hushallsost", "Iberico", "Idaho Goatster", "Idiazabal", "Il Boschetto al Tartufo", "Ile d'Yeu", "Isle of Mull", "Jarlsberg", "Jermi Tortes", "Jibneh Arabieh", "Jindi Brie", "Jubilee Blue", "Juustoleipa", "Kadchgall", "Kaseri", "Kashta", "Kefalotyri", "Kenafa", "Kernhem", "Kervella Affine", "Kikorangi", "King Island Cape Wickham Brie", "King River Gold", "Klosterkaese", "Knockalara", "Kugelkase", "L'Aveyronnais", "L'Ecir de l'Aubrac", "La Taupiniere", "La Vache Qui Rit", "Laguiole", "Lairobell", "Lajta", "Lanark Blue", "Lancashire", "Langres", "Lappi", "Laruns", "Lavistown", "Le Brin", "Le Fium Orbo", "Le Lacandou", "Le Roule", "Leafield", "Lebbene", "Leerdammer", "Leicester", "Leyden", "Limburger", "Lincolnshire Poacher", "Lingot Saint Bousquet d'Orb", "Liptauer", "Little Rydings", "Livarot", "Llanboidy", "Llanglofan marmhouse", "Loch Arthur Farmhouse", "Loddiswell Avondale", "Longhorn", "Lou Palou", "Lou Pevre", "Lyonnais", "Maasdam", "Macconais", "Mahoe Aged Gouda", "Mahon", "Malvern", "Mamirolle", "Manchego", "Manouri", "Manur", "Marble Cheddar", "Marbled Cheeses", "Maredsous", "Margotin", "Maribo", "Maroilles", "Mascares", "Mascarpone", "Mascarpone (Australian)", "Mascarpone Torta", "Matocq", "Maytag Blue", "Meira", "Menallack Farmhouse", "Menonita", "Meredith Blue", "Mesost", "Metton (Cancoillotte)", "Meyer Vintage Gouda", "Mihalic Peynir", "Milleens", "Mimolette", "Mine-Gabhar", "Mini Baby Bells", "Mixte", "Molbo", "Monastery Cheeses", "Mondseer", "Mont D'or Lyonnais", "Montasio", "Monterey Jack", "Monterey Jack Dry", "Morbier", "Morbier Cru de Montagne", "Mothais a la Feuille", "Mozzarella", "Mozzarella (Australian)", "Mozzarella di Bufala", "Mozzarella Fresh, in water", "Mozzarella Rolls", "Munster", "Murol", "Mycella", "Myzithra", "Naboulsi", "Nantais", "Neufchatel", "Neufchatel (Australian)", "Niolo", "Nokkelost", "Northumberland", "Oaxaca", "Olde York", "Olivet au Foin", "Olivet Bleu", "Olivet Cendre", "Orkney Extra Mature Cheddar", "Orla", "Oschtjepka", "Ossau Fermier", "Ossau-Iraty", "Oszczypek", "Oxford Blue", "P'tit Berrichon", "Palet de Babligny", "Paneer", "Panela", "Pannerone", "Pant ys Gawn", "Parmesan (Parmigiano)", "Parmigiano Reggiano", "Pas de l'Escalette", "Passendale", "Pasteurized Processed", "Pate de Fromage", "Patefine Fort", "Pave d'Affinois", "Pave d'Auge", "Pave de Chirac", "Pave du Berry", "Pecorino", "Pecorino in Walnut Leaves", "Pecorino Romano", "Peekskill Pyramid", "Pelardon des Cevennes", "Pelardon des Corbieres", "Penamellera", "Hereford Hop", "Herrgardsost", "Herriot Farmhouse", "Petit Pardou", "Petit-Suisse", "Picodon de Chevre", "Picos de Europa", "Piora", "Pithtviers au Foin", "Plateau de Herve", "Plymouth Cheese", "Podhalanski", "Poivre d'Ane", "Polkolbin", "Pont l'Eveque", "Port Nicholson", "Port-Salut", "Postel", "Pouligny-Saint-Pierre", "Pourly", "Prastost", "Pressato", "Prince-Jean", "Processed Cheddar", "Provolone", "Provolone (Australian)", "Pyengana Cheddar", "Pyramide", "Quark", "Quark (Australian)", "Quartirolo Lombardo", "Quatre-Vents", "Quercy Petit", "Queso Blanco", "Queso Blanco con Frutas --Pina y Mango", "Queso de Murcia", "Queso del Montsec", "Queso del Tietar", "Queso Fresco", "Queso Fresco (Adobera)", "Queso Iberico", "Queso Jalapeno", "Queso Majorero", "Queso Media Luna", "Queso Para Frier", "Queso Quesadilla", "Rabacal", "Raclette", "Ragusano", "Raschera", "Reblochon", "Red Leicester", "Regal de la Dombes", "Reggianito", "Remedou", "Requeson", "Richelieu", "Ricotta", "Ricotta (Australian)", "Ricotta Salata", "Ridder", "Rigotte", "Rocamadour", "Rollot", "Romano", "Romans Part Dieu", "Roncal", "Roquefort", "Roule", "Rouleau De Beaulieu", "Royalp Tilsit", "Rubens", "Rustinu", "Saaland Pfarr", "Saanenkaese", "Saga", "Sage Derby", "Sainte Maure", "Saint-Marcellin", "Saint-Nectaire", "Saint-Paulin", "Salers", "Samso", "San Simon", "Sancerre", "Sap Sago", "Sardo", "Sardo Egyptian", "Sbrinz", "Scamorza", "Schabzieger", "Schloss", "Selles sur Cher", "Selva", "Serat", "Seriously Strong Cheddar", "Serra da Estrela", "Sharpam", "Shelburne Cheddar", "Shropshire Blue", "Siraz", "Sirene", "Smoked Gouda", "Somerset Brie", "Sonoma Jack", "Sottocenare al Tartufo", "Soumaintrain", "Sourire Lozerien", "Spenwood", "Sraffordshire Organic", "St. Agur Blue Cheese", "Stilton", "Stinking Bishop", "String", "Sussex Slipcote", "Sveciaost", "Swaledale", "Sweet Style Swiss", "Swiss" }; private String py[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R" ,"S","T","U","V","W","X","Y","Z"}; }
评论
4 楼
蓝月儿
2012-08-09
有图片吗,有图片会更好些
3 楼
yzx503319102
2011-11-25
楼主最好加上效果图 这样会比较好
2 楼
aichixihongshi
2011-09-28
中文转成字母不就ok了吗,网上有例子。过段时间 我再把中文的贴上
1 楼
阿顺顺
2011-09-28
LZ 的排序全部都是英文,可是中文的,就无法排序了!!最近要做用户列表的排序,类似Android联系人,有字母的快速索引以定位,不知LZ有没有好的办法??我Q:914575565
发表评论
-
Fragment 横竖屏切换问题
2013-04-24 14:41 1868在默认情况下当发生横 ... -
Android EditText 增加自定义过滤
2012-02-19 22:20 2430在Android中,可以通过对EditText设置setFil ... -
解决android textview自动换行问题
2012-02-16 11:46 10795今天忽然发现android项目中的文字排版参差不齐的情况非常严 ... -
通过adb命令获取Android手机的IP地址
2011-12-30 19:11 4404要获取Android手机的IP地址,必须先保证你的Androi ... -
Android 图形用户界面 之 绘图(二) Paint类 主要方法介绍
2011-12-30 09:10 1474/** * Paint类介绍 * * Pa ... -
ListView底部分隔线的问题
2011-12-20 14:42 4334在工作中遇到了一个难题,就是一个listView在最下面的一个 ... -
android获取手机上的图片和视频缩略图thumbnails
2011-11-03 22:05 10079转贴自:http://www.android123.com.c ... -
Activity中使用AIDL让Service与Activity通信
2011-10-25 00:06 2808简易计算器,默认执行1+1的计算,点击go按钮执行计算,先看效 ... -
Android图形报表之AchartEngine(附开发包+API文档)
2011-10-22 16:49 11418统计报表: Java4Less (http://java4le ... -
android中用Spannable在TextView中设置超链接、颜色、字体
2011-10-21 23:08 50572昨晚研读 ApiDemo 源码至 com.example.an ... -
android动态设置TextView字体颜色
2011-10-21 11:50 6484最近写程序就遇到了这么个难题,在TextView 上,正常字体 ... -
layer-list和include的使用
2011-10-20 10:14 2421layer-list,include,merge使用,记录一下 ... -
自定义AlertDialog样式,根据屏幕大小来显示
2011-10-19 12:43 4636先介绍一些关于AlertDialog的基本知识: ... -
Android获取屏幕分辨率及DisplayMetrics简介
2011-10-19 08:56 2842Android 可设置为随着窗口大小调整缩放比例,但即便如此, ... -
android资源文件访问android.resource
2011-10-17 09:14 4225android.resource使用转自:http://www ... -
ImageView添加边框
2011-10-16 19:37 2123import android.content.Context; ... -
Android 实现TextView中文字链接的方式
2011-10-16 14:08 2532Android 的实现TextView中文字链接的方式有很多种 ... -
android实现TextView多行文本滚动
2011-10-16 13:38 6452Android中我们为了实现文本的滚动可以在ScrollVie ... -
ListView之setEmptyView的问题
2011-10-15 23:19 4984使用listView或者gridView时,当列表为空时,有时 ... -
去掉TabActivity底部默认白线
2011-10-15 16:38 3313经过一翻百度,google终于实现了TabActivity设置 ...
相关推荐
python入门-30.寻找列表中只出现一次的数字——寻找单身狗.py
linux优化笔记,配套视频:https://www.bilibili.com/list/474327672?sid=4496133&spm_id_from=333.999.0.0&desc=1
知识付费系统-直播+讲师入驻+课程售卖+商城系统-v2.1.9版本搭建以及资源分享下载,CRMEB知识付费分销与直播营销系统是由西安众邦科技自主开发的一款在线教育平台,该系统不仅拥有独立的知识产权,还采用了先进的ThinkPhp5.0框架和Vue前端技术栈,集成了在线直播教学及课程分销等多种功能,旨在为用户提供全方位的学习体验,默认解压密码youyacaocom
美妆神域-JAVA-基于springBoot美妆神域设计与实现
原生js制作Google粘土logo动画涂鸦代码.zip
golin 扫描工具使用, 检查系统漏洞、web程序漏洞
原生态纯js图片网格鼠标悬停放大显示特效代码下载.zip
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
去水印web端独立版web
原生js制作左侧浮动可折叠在线客服代码.zip
Chrome 谷歌浏览器下载
全新完整版H5商城系统源码 自己花钱买的,亲测可用,需要自行下载 H5商城系统设置是实现商城基本功能的核心部分,涵盖了从网站配置、短信和支付配置,到商品、工单、订单、分站和提现管理等多个模块的设置。以下是详细的设置指南,帮助您快速上手并高效管理商城系统。 测试环境:Nginx+PHP7.0+MySQL5.6 1. 网站配置 设置商城名称、LOGO、标题、联系方式和SEO关键词等,确保商城专业和易于搜索。 2. 短信配置 配置短信接口和模板,用于发送订单通知、验证码等,提升用户体验。 3. 支付接口配置 配置微信、支付宝等支付接口,填写API密钥和回调地址,确保支付流畅。 4. 商品分类管理 对商品进行分类和排序,设置分类名称和图标,便于用户查找商品。 5. 商品管理 添加和管理商品信息、规格、图片等,确保商品信息准确丰富。 6. 工单管理 查看和回复用户工单,记录售后问题,提升用户服务质量。 7. 订单管理 查看订单详情,更新订单状态,支持批量导出,方便订单跟踪。 8. 分站管理 创建不同区域分站,设置权限,统一管理各区域市场。 9. 提现管理
apk安装包
原生js选项卡插件自定义图片滑动选项卡切换.zip
宗教信息佛教佛寺寺庙庵堂相关数据集提供了全国各个地区省市县各个佛教寺庙的详细信息。这些数据不仅包括寺庙的名称和负责人姓名,还涵盖了所属省份、地级市、区县、具体地址、建立日期以及支派类别等关键信息。该数据集整理了超过3万条样本,为研究中国佛教寺庙的分布、历史和文化提供了丰富的第一手资料。这些信息有助于了解佛教在中国的传播和发展,以及寺庙在社会和文化中的作用。数据的整理和提供,对于宗教学、社会学、历史学和文化研究等领域的学者来说,是一个宝贵的资源。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
简单的 Python 版本管理pyenvpyenv 可让您轻松在多个 Python 版本之间切换。它简单、不引人注目,并遵循 UNIX 传统,即使用单一用途的工具来做好一件事。该项目由rbenv和 ruby-build分叉而来,并针对 Python 进行了修改。pyenv 的作用是什么......允许您根据每个用户更改全局 Python 版本。为每个项目的 Python 版本提供支持。允许您使用环境变量覆盖 Python 版本。一次搜索多个 Python 版本的命令。这可能有助于使用tox跨 Python 版本进行测试。与 pythonbrew 和 pythonz 相比,pyenv没有……依赖于Python本身。pyenv由纯shell脚本制作。不存在Python的引导问题。需要加载到你的 shell 中。相反,pyenv 的 shim 方法通过向你的 中添加目录来工作PATH。管理虚拟环境。当然,你可以自己创建虚拟环境 ,或者使用pyenv-virtualenv 来自动化该过程。目录安装获取 PyenvLinux/UNIX自动安装程序基本
Notepad-v2.20工具,是替代Notepad++的首选工具
原生js随机图片拖拽排序代码.zip
更快、更好、更稳定的Redis桌面(GUI)管理客户端,兼容Windows、Mac、Linux,性能出众,轻松加载海量键值