如果你够酷的话你肯定知道cardslib,这是一个封装了各种CardView的和作为容器的CardListView,CardGridView的一个android控件库 提供的UI组件Card Library provides several custom tags:
It requires API 14+ Qu快速使用Creating a First, you need an XML layout that will display the it.gmariotti.cardslib.library.view.CardViewNative android:id='@+id/carddemo' android:layout_width='match_parent' android:layout_height='wrap_content' android:layout_marginLeft='12dp' android:layout_marginRight='12dp' android:layout_marginTop='12dp'/> Then create a model: //Create a Card Card card = new Card(getContext()); //Create a CardHeader CardHeader header = new CardHeader(getContext()); .... //Add Header to card card.addCardHeader(header); Last get a reference to the //Set card in the cardView CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo); cardView.setCard(card); |
|
来自: scxingm > 《Android 源码》