抽屉 加 主页面显示数据

activity_main.xml布局 (整体布局)

<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout xmlns:android=“http://schemas.android.com/apk/res/android
android:id="@+id/dl_root"
android:layout_width=“match_parent”
android:layout_height=“match_parent”>

<LinearLayout
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="wrap_content">
<com.bwie.xlistview.XListView
    android:id="@+id/list_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"></com.bwie.xlistview.XListView>
</LinearLayout>

<LinearLayout
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="#595353"
    android:orientation="vertical"
    >
   <ImageView
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_gravity="center_horizontal"
       android:src="@mipmap/ic_launcher_round"
       />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="网易云"
        />
    <ListView
        android:id="@+id/list_drawer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"></ListView>
</LinearLayout>

</android.support.v4.widget.DrawerLayout>

MainActivity页面(抽屉的 显示数据 的)

package com.example.lenovo.a06mo1;

import android.content.Intent;
import android.os.AsyncTask;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.L

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
抽屉式效果页面是指在网页中实现类似抽屉的效果,即点击或拖拽某个元素,可以展开或收起另一个元素。要实现这一效果,需要使用CSS和JavaScript的技术。 首先,在CSS中,可以使用`display`属性来控制元素的显示与隐藏。比如,设置一个元素的`display`为`none`,就可以将其隐藏起来;设置为`block`或`inline-block`,则可以将其显示出来。 其次,使用JavaScript来操作元素的显示与隐藏。可以通过事件来监听用户的操作,比如点击或拖拽。当用户点击或拖拽特定元素时,可以通过JavaScript来更改被抽屉效果影响的元素的`display`属性,从而实现展开或收起的效果。 具体实现抽屉式效果页面的步骤如下: 1. 创建一个HTML文件,并引入所需的CSS和JavaScript文件。 2. 在HTML文件中,添需要进行抽屉效果的元素。比如,可以使用`div`来创建一个抽屉效果的容器,并在其中嵌套需要展开或收起的内容。 3. 使用CSS样式来初始化抽屉效果容器和内容的样式,比如设置宽度、高度、颜色等。 4. 在JavaScript中,监听用户的操作事件,比如点击或拖拽事件。 5. 当用户触发操作事件时,通过JavaScript来更改抽屉效果容器或内容的`display`属性,将其展开或收起。 6. 可以添一些动画效果,使抽屉的展开和收起更平滑和流畅。 7. 最后,可以根据需求添其他样式和功能,来进一步优化抽屉效果页面的用户体验。 通过CSS和JavaScript的配合,可以实现各种不同样式的抽屉式效果页面,让网页更丰富有趣。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值