ListView+Fragment实现导航栏

本文档将指导你如何利用ListView和Fragment在Android应用中创建一个导航栏。首先,你需要创建text.xml文件来定义布局。接着,在TestActivity.java中编写逻辑代码。然后,创建MyAdapter类以适配ListView的数据。最后,设计listview_item.xml文件,定义ListView每个条目的样式。
摘要由CSDN通过智能技术生成

实现效果图

     

(1)新建text.xml文件

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:background="@mipmap/main_title_bg"
        >
      <EditText
          android:layout_width="300dp"
          android:layout_height="40dp"
          android:layout_marginLeft="20dp"
          android:layout_centerVertical="true"
          android:background="@mipmap/et_contact_bg"
          android:hint="请输入课程名称"
          android:textSize="15sp"
          />

        <ImageView
            android:id="@+id/iv_no"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:src="@mipmap/course_message_no"
            android:layout_alignParentRight="true"
            android:layout_marginTop="5dp"
            android:layout_marginRight="10dp"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height&#
  • 0
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值