码迷,mamicode.com
首页 > 其他好文 > 详细

65.Card View

时间:2017-09-21 22:21:25      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:match   over   write   http   .class   structure   widget   als   fragment   

First . File -> Project Structure -> CardView(come.android.cardview:v7.25.0.0;

Second. drawable -> right click on the folder -> and then select batch drawable importer.-> rename target name;

Third . new layout resource .named fragment_cake. rewrite the root element android.support.v7.widget.CardView

Fourth. xmlns:card_view = "http://schemas.android.com/apk/res-auto" .cardview = CornerRadius = "4dp"

Fifth . Creat FragmentCake.class,   

  public FragmentCake extends Fragment{

     public FragmentCake(){   

 }

  @Nullable 

  @override

  public View onCreatView(LayoutInflater inflater ,@Nullable viewGroup container,@Nullable Bundle saveInstancestate){

    return inflater.inflate(R.layout.fragment_cake,container,false);

  }

   }

Six. Rewrite activity_main.xml

  <fragment

    tools:layout = "@layout/fragment_cake"

    android:id = "@+id/fragmen"

    android:name = "com.bodor.fragmentcake"

    android:layout_width = "match_parent"

    android:layout_height  = "wrap_content"

    

 

65.Card View

标签:match   over   write   http   .class   structure   widget   als   fragment   

原文地址:http://www.cnblogs.com/L1nus/p/7571530.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!