发表于: 2018-04-13 01:07:22

1 689



头部toolbar是我第一次使用,一开始想过使用ActionBar,但是发现很难实现出项目效果,经过查阅后决定尝试一下Toolbar

<android.support.v7.widget.Toolbar
   android:id="@+id/mToolbar"
   android:layout_width="match_parent"
   android:background="?attr/colorPrimary"
   android:layout_height="wrap_content">

   <TextView
       android:id="@+id/sign_exit"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="取消"
       android:textColor="@android:color/white"
       android:textSize="20sp"/>

   <TextView
       android:id="@+id/sign_title"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="注册"
       android:gravity="center"
       android:textColor="@android:color/white"
       android:textSize="20sp"/>

   <TextView
       android:id="@+id/sign_login"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="登陆"
       android:gravity="center"
       android:textColor="@android:color/white"
       android:textSize="20sp"/>

</android.support.v7.widget.Toolbar>

非常简单的用法,直接在Toolbar上的自定义View做了文章。

但是发现一点就是Toolbar实际上提供有不少功能,反而在自定义上会有不少限制(参考https://blog.csdn.net/jungle_pig/article/details/52785781)

而我因为项目需求其实只用得到普通子View部分,这样实际上还不如去自定义一个布局嵌套做成一个头部栏。

不过因为也做了,就暂且罢了,以后要改进的时候可以再弄。至少认识了一点ToolBar的使用。


其次就是上传作业,第一次使用github上传本地项目,之前也弄过git不过一直没用过,(参考了https://blog.csdn.net/shu580231/article/details/77051875的内容,说的真的不错。)

这其实就是我今天做这个项目的比较大的困扰了。

昨天了解到这是一个通过做项目驱动学员学习的时候我就尝试着来了,不过让我挺诧异的是几乎完全给出了任务就没有指引了,就说让自己去百度,我个人也是之前零基础走来,认为一开始就这样去学肯定会摸不着头脑。

还好就是自己本来有些基础,任务一很快就做完了。

其实因为基础不差所以做起来蛮轻松,但是要是零基础的同学从这个项目开始真的要花的功夫太大了,首先没有一个方向就算去百度查也会很难查得到,所以我还是对该站的“零基础不收费放养”的做法很迷惑,有一些蛮不错的项目提供,不过终究是免费的。师兄在群里回复也不会太及时,所以基本上是独自完成的,基础也是先前积累的,我认为没有之前积累可能也做不到2~5天做出来这个对我现在来说的小任务。



返回列表 返回列表
评论

    分享到