设为首页 加入收藏

TOP

viewpager无线轮播获取网络图片(一)
2017-10-13 10:37:04 】 浏览:2474
Tags:viewpager 无线 获取 网络 图片

 

生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气

首先创建小圆点

 小圆点的两个属性一共两个属性另一个跟这个一个样,只不过颜色能让我们区分的

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >


    <corners android:radius="8dp" />


    <solid android:color="#e2061c" />


</shape>

接着小圆点的布局是一下自己看吧

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <View
        android:id="@+id/scrollView"
        android:layout_width="8dp"
        android:layout_height="8dp"
        android:layout_margin="8dp"
        android:background="@drawable/dots_normal"
        />

</LinearLayout>

生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气

下面是main.xml里面的布局

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
   >
    <android.support.v4.view.ViewPager
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </android.support.v4.view.ViewPager>
    <LinearLayout
        android:id="@+id/ll"
        android:layout_marginTop="450dp"
        android:orientation="horizontal"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="20dp"/>

<Button
        android:id="@+id/bt_tiao"
        android:text="主页"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</RelativeLayout>

生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气

//获取图片需要图片的包

Universal-Image-Loader

  下面是代码

 

public class MyApp extends Application{

    @Override
    public void onCreate() {
        super.onCreate();


        ImageLoaderConfiguration configuration = ImageLoaderConfiguration.createDefault(this);
        ImageLoader.getInstance().init(configuration);
    }
}

生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气生气

Universal-Image-Loader  导入包

生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气 生气

 

添加权限

<uses-permission android:name="android.permission.INTERNET" />

android:name="My

首页 上一页 1 2 3 4 下一页 尾页 1/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Android开发笔记: 5种对话框案例 下一篇简单的界面开始

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目