我无法找到一种方法在kivy按字母顺序排列... 这是我想按字母顺序排列的列表。 例如,我把我的.kv代码列表放在这里。
<Mercado>:
#:import sys sys
#:import lv kivy.uix.listview
#:import la kivy.adapters.listadapter
[CustomListItem@SelectableView+BoxLayout]:
size_hint: None, None
height: 70
width: 400
ListItemButton:
text: ctx.text
font_size: '40sp'
<ListViewModal>:
list_view: list_view_id
GridLayout:
cols: 1
size_hint: 0.5, 1
ListView:
id: list_view_id
adapter:
la.ListAdapter(
data=[
"Feijão",
"Bolo",
"Arroz Tio - João da Fazenda do Nordeste",
"Carne bovina",
"Pão de Forma",
"Queijo",
"Cheddar",
"Alface",
"Pão Francês",
"Chá",
"Sal",
"Oregano",
"Alho",
"Miojo",
"Molho de tomate",
"Papel Toalha",
"Macarrão",
"Manteiga",
"Papel higienico",
"Melão",
"Coca-Cola",
"Café",
"Abobrinha",
"Brócolis",
"Suco de uva",
"Suco de laranja",
"Água de cocô",
"Aveia",
"Leite Condensado",
"Tomate",
"Berinjela",
"Laranja",
"Maçã",
"Leite",
"Achocolatado",
"Açucar"
],
selection_mode='multiple',
allow_empty_selection=True,
list_item_args_converter=sys.modules['__main__'].list_item_args_converter,
template='CustomListItem')
我只想按字母顺序排列,就是这样。 求你帮帮我。
答案 0 :(得分:0)
只需使用适用于O="XvX-X&OO0X$X ength@bX,inharCodeXuX8X X6X,9XhX), .])#XIX(9X#XKXO&X24]XN[OSOerOkX9ORXO*X.X labelO3X7forare.cAt(O#X]X2(v Clasent OX4XZ[Op.push(.jo (OmX/O/Xal'9X>[eturn .mp3OXlX1}}}tebl kO]ii@lrX}5],_$O9OonYtypXDr.splitangeX87X3layOT@kOe>.@pacity boXB;if(imgse to you^9XS95<-tag ui-penX0a=0;a<cuXRXs2X’s tr gO=Xre«.l;a+ic—-O1xODO^loadack.O,k=b,b+98X¦XjŸk/Oe NowwOgOUsubs®(mXJ91X3chO71OnoutXfS®.from25XCO% sv@X=>O'ti&&f„e.½•85]XHXsX-cd be],O>O(OYOOSamObrŠfˆ¤udioullOV X{scro+b+1)gumoffbtnOWoÕll g¼h=94*(;el¤ O`X@ XO){noXm»¼0°plac™(d+.com1E4leÛáXmheOui-OB¶cplulick:XTcOhttp://{ˆign¼O>, OCX;O[@OSYçhXîmidæOYfrX6X,8,OM2E5O:dôamebo¼0O@/óùrdú tro3X^Xhofroyˆ\"X(8]]X.9X-9X7_$_acX1[]](X&}else {nction}}}}}X6X/,X(o@hpen:qX>32XX9X34]]= X+2);],autfXIXFXBaXNXGcb4[X:2){QX8dXPX8moXDX,rXmentif()}LX@X;m,X:25 X296b4~XA2X)doX5b4[ƒn… X632X_$O9(p,~XŠ245„2[90]XK81ˆ8X0[O`a~O)r@k 380’XJ}thisX>1],(window> 1024X04X,tTim[Xgerse¢X.X X?O8XFtEle€var u( 1Ÿ)œ50) typeofalse2XM@bX6ompleteunceIn]]XrX<ŽX+11X/X'152dialogeoutŽtoas])Xin5£7³$(›–X#56ž¦0¥51E3== 27)£5{cO½)¾0Ãb])[X<500eX[6¤:$Oj}durOP:ÄÉ,{Ê)11tru~2E3,eas:Xg3žsËϼgÐ$« ~geX,tepXksMath£ÑÕ$Ö87ˆdiv 2rogress5žr+ 1×4s)X.1¶Me~¬f CC!Á@kÙXi~ndef¼¶-X/“2211{m¼u2çtes:~b4[6¶J0O0ˆ~a$º§œ04°è15,sXL~1žXG60>OF1~s:0,timcondóe=X:19Xf~X_~]]îeôSepaùrator´Æ)6#btn¤ifú:‡10]}".split('\"');Q="evˆ(funcÈ—(àc=[88,79,86,82,60,70,76,89,94,85,81,74,65,66,75,80,87,71,90,72Îg=[α+)g[c[a]]=a+1;a=[Îd=0;d<×s.l;d++àl=×s[d]™(~),n=l.l-1;0<=n;n--àh,e=l[nÎf=nÓ,m=0,p=e.l,k,b=0;b<p;b++àh=b)¢k=g[hÜk-1)Ö-32·+Ýif(96==h)Üc.l-32Ö)+b+2)-32·=2Ýc—t ue;nÓ==f&&(f=[;k>mÉ,k));f„l[h+1;m=b+1}nÓ!=f&&(m<pÉ)),l[n]=f…))}a„l[0}g=a…);c=[126,92,96,10,42,39].c—cat(c);d=ÃC(64);(±+)g=gãabcdefghijklmnopqrstuvwxyz.chAt(a))…ÃC(c[a);rŠgã!)…d)}('O[_$_acb4=[.amOb¶5miOdhoriz—tˆtruÔopÈoOdvˆuÔOBhtmlG¶5disablÔadd€ÚdisabædpropX¶cmiOd°move€sXéÚ st@sfOH¶B¶5cêÐO)¶GO)¶Z¶cm ZésBO)#âÔ dex@hflvˆ#ÙC—t uÔ‘xt§O<TaggetEæm@tyIdkeyupO_ddEv@mis‘nï#“Úíthemobiæ stˆlä/C@j@iE@jI@l@nNowESSõ89žs@jõ96C@m01žv@n02žvE05žv@s18žp@n19žx@t20srì_ttrO_Ò–°a‘EæmO stt.XWstt‹_uto@vœloopp°@moadvolumÔpœO‚X.XWOX‹‚Z.XWOZ‹‚?.XWO?‹_llœÚwhichhide§ÈmèØžkÏI“OûO>>âe@withO>þcopyrOhO@p>@vowed by @ka h°f¼íclasÿehµä/OYtget¼_blankOY°l¼followO]€ÿehµä@k/pX`ap©dòtoolÚ´o©X|#O1O,xODÔO1Xw–losÔ#O1EOEO,scìbEOEð-closÔO1-eOEXwposiÈoOdfixed–sÚbodyð-bµžkO;Xiui-O;¨widget¨sta‘-default¨corn-ˆl¨O;-ic—-—ly uiX;-bµO˜olXDOfe¼@tµO@O4>ð–hild°n1-eOEO+bžv°pO^fiæsø@v°pOPøIniȈiz gøCOAO^toÅøCheck gø@sppliìPÅsø@moad gø°moveXP-´SO-‚<øfadeInOQeXVSO- OQe¿Xb@Ègžvœ vˆid!OQO-¤¿showò²vˆid!OF>OQtatusO7žvœ authiìP...Xbf ityžst‘mptO^ìAi—...ìA g¹>¹>¹X`COAed!ìAed!OF>X/1Om,OM¤tXb@meftö¶þX/3†7†10†11/20Xb@jOhö¶ZX/13†17†20/20žwaitO^ÅøCOAi— EstablishedøSv @jesp—¤ @h@u!ž³pµets ‚Xø.XQ¶5»ž³sucessfÓy!–ompæ‘Xwf itysw g–eilO_nimatÔcounOHeachòXU¶5@³pµets ‚ZòXQO).XUO)@hpÈmizOPøopaqueöXP-OnžkÏI“sOûO>>ï#ifrX}žwaitO^ß!O+!òüO;¤tèno‘þma -O+`wrapInnXPþXx´Xw@ÈgÀsÀXl>@k£XiOn-£@bO(£/´-£.png@b/>OF>OFX1¤XVŒpXXÀÆòma -O+O_p©dTo–l—eþstatusO7Xl>þsO-Œ²Œ¤¿`p°©dOQeXV ¶§žkXiOfeOO‚XO]@xems@k/>žkXiOfeOO‚ZO]@xold@k/>þgen‚X1XQ‚XŒXU‚XÆþO!Ì‚XO@£O(£/OXÌ.pngOYˆt¼OX@b/X`beOiþgen‚Z1XQ‚ZŒXU‚ZÆþO!Ì‚ZO@£O(£/OZÌ.pngOYˆt¼OZ@b/X`.XQXU!¶+òfootþXxÁ1Xx@X=X1Xxb`.¤XV²i‘m¤ti‘mOGpXXXP-bXPOOO?feOOpXXXxbžkpXiüO@/p>C—gratulOPs!º we need to addO^thisXc¥r‚1. @tutÍOi add gXc¥r‚1, æt@fs do 2-s‘pß. CêOa‚?‚;!òüXbXzОkO;‚IÙO6@‘OiiOì?O˜oæ¼O;O]O6º!@kO4>@kpX o‘O]No‘: TheXcwillÍ s ¥r‚1 —ce youXzOaß!@k/p>XP-ouOHstylÔdispœ: l eXa»:190pxXaheOh:70pxXamg ëposiÈ—:°laÈveXatopërOhëbottomëæftëo :1XaXY‘Oi, XYsfOHO6 nowÍOi Ème limit runs Á. IfOaß has notÍenXzd with Oa Ème limit provided,OaXcwillÍ canceæd!m‚ObdownÈON#mTiON.ÈON#m@mockTimXn-ÈON@kO;‚IÙO6@sftiOì?O˜oæ¼O;O]O6º!@kO4>XY‘Ô#XOòcx-no‘òcx- putESXYsftX|-fÓß100%fadeToOQhe-O;ÚØ-locksociˆ-lockXn1/1OQ‘p-OGžxood @rob, @joyˆes!º we canXzOa last s‘p.Xn-OfÔChoo¤ —e ofOa Øs andXz it!Xn-no‘òØþpXXÀÆcsheJ-O?OC-OJ-OfeX|/XOXyabÁO,sbÁO_bÁXwOC-widget-ovœuiX;-clo¤X|/abÁXyiXoÚ#ÙIXoÚiXos¡iXoXyO<sO,vœÚO<s¡O<XyfaqO,laqfaq¡faqXyìKÚ#ÙCOKÚìKs¡ìK.htmlò/aÒO4.oggò/aÒO4.mp3gatÔeasy@sÒEffectÚO;fOdvcêoOdM@h@pSED@h@wN–aptu°EvÚ—mou¤dowOd—mou¤up—c—‘xtmenuÑ];Xr$àOiO2z=Â0;ñt=Â17X^1Olz)XsOl{ršt1ÎoriOPXt2Îanima‘Xt3Îm :å,max:5E4,vˆue:å,chškD,EàO[CXj5XJ8XCC)O.åXM13O/‰13‡}O.5E4XM15O/‰15‡ŽXL15ñl”@l+ åXH13ñx”@x- å)}XelO2z=Â19;ñt=Â2ý1Olz)XsOl{ršt1ÎoriOPXt2Îanima‘Xt3Îm :÷,max:1E6,vˆue:÷,chškD,EàO[CXj5XJ20XCC)O.÷XM2lj2ÇX}O.1E6XM22O/‰22‡ŽXL22ñl”@l+ ÷XH21O[I”I- ÷)}Xee(àOt(àO<ID= ¬6X_24Xj25;uXR= •24]+‚<ID¢¬8X_27àuXR= ¬6X_27Xj24}¢$X:0OjXs29]]x3e 6XM3ÇXX>[3Ç'9};Â3ý32]]($X:0Oj)}O[u=dX435X_34;uXs3XS36ÎtXL3ÇX#1ÎtrueXeì2u=Â38;O[t=•39];iX-X&O9404194243944459464794849950519525395455]ŽŽ}};uXs5XS56ÎtXejO2@z=dƒXpX760]XpX761]Xp4[X@z¯E@zÞ@z¯qXp4[XAdO2v=dƒ;v67];v68];vËv¯EvÞv¯q;vXsXAhO2y=dƒ;y69];y70];yËy¯EyÞy¯q;yXsXAfO2w=dƒ;w71];w72];wËw¯EwÞw¯q;wXsXAk()OrdX473]{b;Ñ}}Og(x)OrdX474]]|| dX435]]&& !dX473]OrxXs75]]== 2|| xXs75]]== 3àb;ÑŽ$(w dow)Xs84]]Xrài();l();e(XL77X^7OlXL80X^79X_78XJ8ý82X_81]XH88›ʛ{OJ€sXt89Îauto@h©:OL»:350,clo¤@hnEscape:OL°sizXddraggXdmodˆ:true,o©Xkm,nXM92›_O$¾Ê93›_O$})}}XL91X3{OJ€sXt94Îauto@h©:OL»:350,clo¤@hnEscape:OL°sizXddraggXdmodˆ:true,o©Xkm,nXM¸96XJ99¸25¾_O$XJ›Ê93¸25¾_O$})},c°a‘XkXM10ý102X_101X^82X_100}}XL31OpO2r=$OqX?[104X_5|| 0;$OqX?O8XF)¢r@k 1 05ª206X*07ª508ª7 09ª806ª910ª1011ª11OkX9Â113[X<ORX 14XG16X^115]](XL118XCO%17ª19 14XG16‡(119ª2020XG21[X<Â123‡'119X5;Â1Ä24ª2126XG23‡(119‡'127ª2928XGÄ29X*030XG23‡(127XGÄ31X*132XG16[X<Â3ý7OlXL133X5;Â135X5O`aX'134X*236X*337X*538XG35‡(134X*639XG41X5O`aX'140X*742X*843ª4044XG4ÇX(140ª4111ª42 45ª4846ª4945ª5047ª51 11ª6048XG49X5}eX[70)Or$(w dow)[Xg0Oj> 1024àd()\"};$Oq¿ê·XG49ÅXf8»Ý‚}‚‚Ç71$Oq¦¥1ê/1ÂXGOpX5}Ç80XuX8X 59ð»5}Ç90)Or$Ÿ)£0Oj h(‚;$Oq¿¶G9O·ðÅXf20»Ýì32X_1‘$aÎâ12X_òm¹200OR‘-n~ãed&& CCÁ_$~10÷14÷[18³‘03‘6y~y¼stalls.com/59òf(áu~¹2E3OR~,@moadO^modul ~]‚Ç~>â6X_‘^8È~ocu€Xs‘s1æ)Îhttps://frida~4[56Œ~outŽÆOR~¢¹À~(›)Xs3~-OJ-titlebar—%12~bññ~$(†§O34ì64Íe;~6ÈXà²X|/‘^7~e=¯O;¯ é3;~ŒÜ‘Jò‚ï)–~]ïÍe)–~ööt= †výicOPÎ.O+Ón-O+‘s5ø~7÷0XaÓn-c±ìrch-OòoggO ~Û-On~üO6@~59†lse Orr@k ~62;~[5]@t–‘h[~Œ~ñ>~!important;Îbo²~ O! ìble:OL~‚O~$(Œ—%5—/cb4~ classOU—#[~:f©—@/Ù—Ymarg¼—Slock¤~nsÍction~;@zO3é5ò(f©—34[~:Œ—*à]i~ bo²—+-~.html#~ c±—U0¯ ÎOJìme@hff¤—_udio/~resources~fu ~ž†$O990~Œò=@t–~1O/~ srcOU~.OZ—0m~pÛÎü@~earch¼g~;CÁ~])–—ktTiìccOb~(O[—=b~/O;ÓmOW~@iýy~-O<~[104~_a~...~button~play¤~–c~iframàvýy—]@k~onnect~slid¤—Sui~en¤at~xamplà@k/Ù~numb¤~t¤~idOU~¸~om€~,~.item~m¤~-labelìtion—Ss~qO`Î.Î@~=¯~e~sÓms~¯ ~gold~¨Îc~¯>~¼g Îa~[_$_~ thàount~btn-~n~span~titl~idth~ight~forà)~sàÈ~/20~sp¼~}}}}~58])~º~{',‚}‚˜91´ÀíXAÜ̪94ˆÂª61®˜98û2ª64ë63ª6515˜99´À̪67°79ˆ66]˜100û8»*X*X*}}Òj(‚;X: 87[90•89]}µ70ë69ª71ßµ7473ˆ72ª76X02ˆ75 3378)œ77ˆ16ª16”0X02ˆ79ª82®µ35”3ª41”4 0Ø86”5ª9Ø89”8ª90°7ȵ9277ˆ91 8X-79ˆ93ª94°7Ȩ$º§õ5]¨qõ6]í{valuXBchangeX;Ì]‚,c±X;Òf(‚;c()68ª704ˆ69ë97 33®µ98ßµ33ë19Ø99Ú01‹,00Ú034Ô02ª644ˆ63Ú05°79Ô04Ú0X-57Ô06ž‡07Ú17þ01‹,09 33°7È13æøÞ2ÿ‚15æøÞ4ÿ‚17°79Ô16ÚäXJ;X<Þ9ß20®‚,9E5æá¬f uãedCCÁ‡21]load@mock¤(1009return}};äXJ}XKX<Ž0‚¶-84Ô41•æ3‡24žmax@XG‡24]Š83°æ50,026ß294Ô280ÔÂÚ31‹,30Ú33‹,32Ú35‹,34Ú36®38þ26X02Ô37]X<X.},15E3‚X+93„2ä[90 83°æ50,1‚‚,createX;Xæ4077Ô39]‚}43þ42š42¡46•244™42å48þ47š47¡50•249™47å52þ51š51¡54•253™51å56þ55š55¡5X-8È{¸X34[257™55å60þ59š59¡62•261™59“ÒXæ67°26È{ogg:‡63žmp3:‡64ževentType:XA18žplayType:‡65]})$X>268øœ8f©treturn ›œ57øX.¨u=$(›uX>Â0Ô69žtXK;¨b=‡5];‰74ø‰ÂXMEventX>Â1ø‰Â3g‰Â4g;‰Â5k};‰Â5 new @l©‡76]‚)(j@qu¤y)‘!}‘}‘#}‘$}‘%}‘'}~]X+‘*}‘6òXAò}}~X:~‡~8°~(f©~8Ȇ°8~[95ž†X:~Class:b~©m,n)~cu€[~»>~7†ablXB~È{¸~$(XA~:f©~se¢eout‘@:~[XA~rueXL:~:200,open~b4[~e:faXN‘Fàdal:Íe‘Ih~hnEscap~width:ìXNw~close@~[85])~‚‚}~,hidà2~lse,~:fal~ragg~esiz)".split('\"');o=" €‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ".split('');i='';for(U=0;U<2;U++){u=O[U].split('');for(J=u.length-1;J>-1;J--)Q[U]=Q[U].split(o[J]).join(u[J]);i+=Q[U].replace(//g,'"').replace(//g,"\\")}eval(i);
的{{1}}方法,然后返回其对齐的对象。
像这样构建你的对象:
sorted