• 冲刺!


    昨天:初步学习了SQLItem数据库。

    困难:概念懂了,一些具体的用法还有待练习。

    今天:做标签栏,结果fragment把我整懵逼了。

    <?xml version="1.0" encoding="utf-8"?>
    <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    
        <com.google.android.material.appbar.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppTheme.AppBarOverlay">
    
            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:minHeight="?actionBarSize"
                android:padding="@dimen/appbar_padding"
                android:text="@string/app_name"
                android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title" />
    
            <com.google.android.material.tabs.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?attr/colorPrimary" />
    
            <LinearLayout
                android:id="@+id/bottomlinear"
                android:layout_width="fill_parent"
                android:layout_height="60dp"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:background="#DCDCDC">
    
                <Button
                    android:id="@+id/btn_first"
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:padding="-5dp"
                    android:textSize="14sp"
                    android:text="主界面"
                    android:background="#DCDCDC" />
    
                <Button
                    android:id="@+id/btn_second"
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:textSize="14sp"
                    android:text="近期消费"
                    android:background="#DCDCDC"/>
    
                <Button
                    android:id="@+id/btn_third"
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:layout_weight="1.5"
                    android:textSize="14sp"
                    android:text="添加账单"
                    android:background="#DCDCDC"/>
    
                <Button
                    android:id="@+id/btn_four"
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:textSize="14sp"
                    android:text="修改账单"
                    android:background="#DCDCDC"/>
    
                <Button
                    android:id="@+id/btn_fifth"
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:textSize="14sp"
                    android:text="预期消费"
                    android:background="#DCDCDC"/>
    
            </LinearLayout>
    
            <LinearLayout
                android:id="@+id/cursorarea"
                android:layout_width="fill_parent"
                android:background="#CDCDCD"
                android:orientation="horizontal"
                android:layout_height="2dp">
    
                <TextView
                    android:id="@+id/txtv_bottom1"
                    android:layout_width="0dp"
                    android:layout_height="2dp"
                    android:layout_weight="1"
                    android:background="#ff0000"
                    android:visibility="invisible"/>
    
                <TextView
                    android:id="@+id/txtv_bottom2"
                    android:layout_width="0dp"
                    android:layout_height="2dp"
                    android:layout_weight="1"
                    android:background="#ff0000"
                    android:visibility="invisible"/>
    
                <TextView
                    android:id="@+id/txtv_bottom3"
                    android:layout_width="0dp"
                    android:layout_height="2dp"
                    android:layout_weight="1.5"
                    android:background="#ff0000"
                    android:visibility="invisible"/>
    
                <TextView
                    android:id="@+id/txtv_bottom4"
                    android:layout_width="0dp"
                    android:layout_height="2dp"
                    android:layout_weight="1"
                    android:background="#ff0000"
                    android:visibility="invisible"/>
    
                <TextView
                    android:id="@+id/txtv_bottom5"
                    android:layout_width="0dp"
                    android:layout_height="2dp"
                    android:layout_weight="1"
                    android:background="#ff0000"
                    android:visibility="invisible"/>
    
            </LinearLayout>
    
        </com.google.android.material.appbar.AppBarLayout>
    
        <androidx.viewpager.widget.ViewPager
            android:id="@+id/view_pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    
        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="@dimen/fab_margin"
            app:srcCompat="@android:drawable/ic_dialog_email" />
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
    View Code

    这就是个半成品(或者就是个废品),明天再看看有没有别的方法。

  • 相关阅读:
    关于Jupyter Notebook默认起始目录设置无效的解决方法
    关于二叉树中度为0与度为2节点数关系证明
    LeetCode第[3]题(Java):Longest Substring Without Repeating Characters 标签:Linked List
    数据结构,物理结构,存储结构,逻辑结构的区分
    条件变量 sync.Cond
    defer 的常用场景
    switch...case... 语句中的类型转换
    golang 切片和数组在for...range中的区别
    golang 并发顺序输出数字
    Golang 中哪些值是不可以寻址的
  • 原文地址:https://www.cnblogs.com/vvxvv/p/12775655.html
Copyright © 2020-2023  润新知