Domanda

Ho bisogno di creare un componente personalizzato in Flex 4.5 estendendo la classe lista scintilla. Fondamentalmente, voglio aggiungere una nuova variabile denominata "titolo" di tipo UIComponent. Quando è impostata questa variabile, ho bisogno di renderlo in cima alla lista.

Questo mi darebbe una lista con una componente titolo configurabile che scorre con la lista. Dovrebbe essere semplice, ma non riesco a capire come si fa. Ho guardato tutta la strada fino alla gerarchia di spark.components.List e spark.skins.mobile.ListSkin e leggere alcuni articoli su skinning, ma tutti i tutorial sono estremamente semplificata e non mostrano come fare qualcosa di simile.

Qualsiasi aiuto? Grazie

È stato utile?

Soluzione

I would look into the following flex POC: iOS Theme. There are multiple parts to the list, but you can download the example projects are on the page. The component is called the ListForm and there is a skin, an ActionScript component, and an Item Renderer. The IR is less important and you can create your own which matches what you need, but the ListForm.as file and the corresponding skin do pretty much what I gather you need.

Altri suggerimenti

Just create a new skin; and add the title section above the DataGroup.

You don't need to extend the List class unless you want to add new properties related to your title.

This is exactly what we did for our Mobile Flex DropDownList. Click the "Change Skins" button and select PopUpSkin 2. Then open the drop down; you'll she list in the pop up w/ a header above the list and a cancel button below it.

In practice, it is odd to use UIcomponent directly. Can you expand more on what you want to put in the title?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top