zoukankan      html  css  js  c++  java
  • Android Studio--家庭记账本(二)

      家庭记账本APP目前实现了记账功能,也就是说增加功能,今天打算添加删除功能,参考着增加的代码研究,从网上查阅资料,打算实现左滑删除功能,目前学到了xml里面的HorizontalScrollView布局,可以将删除按钮隐藏在最右侧,左滑可以将其显现出来

    <?xml version="1.0" encoding="utf-8"?>
    
    <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="80dp">
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
    
            <TextView
                android:id="@+id/tv_title"
                android:layout_width="150dp"
                android:layout_height="80dp"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="10dp"
                android:ellipsize="marquee"
                android:gravity="center"
                android:singleLine="true"
                android:text="costTitle"
                android:textSize="35sp" />
    
            <TextView
                android:id="@+id/tv_date"
                android:layout_width="100dp"
                android:layout_height="80dp"
                android:layout_marginLeft="15dp"
                android:layout_toRightOf="@+id/tv_title"
                android:gravity="center"
                android:text="costDate"
                android:textSize="20sp" />
    
            <TextView
                android:id="@+id/tv_cost"
                android:layout_width="100dp"
                android:layout_height="80dp"
                android:layout_alignParentRight="true"
                android:layout_marginRight="20dp"
                android:gravity="center"
                android:text="30"
                android:textSize="30sp" />
    
            <TextView
                android:id="@+id/tv_delete"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="delete"/>
        </LinearLayout>
    </HorizontalScrollView>

     但这仅仅是前端显示了出来,删除功能的实现还是不行。

  • 相关阅读:
    SQL Server 2005存储过程示例
    SQL Server 存储过程
    SQL Server 2005存储过程示例
    转正申请书
    SQL注入天书
    转:毕业半年,我是如何从一名程序员成长为一名项目经理
    DIMFOM
    MONSA
    GLOBSYMM
    MASSHA
  • 原文地址:https://www.cnblogs.com/xhj1074376195/p/12273483.html
Copyright © 2011-2022 走看看