Android项目——网络图片查看器
效果-=--------------》加入包


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="${relativePackage}.${activityClass}" >
<!-- 当width和heigh设置0时
weight表示 渲染的权重 当不指定值时代表的 优先级 默认是1 值越大 优先级越低 -->
<com.loopj.android.image.SmartImageView
android:layout_weight="1000"
android:id="@+id/siv"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<EditText
android:singleLine="true"
android:text="http://img0.bdstatic.com/img/image/shouye/dengni47.jpg"
android:id="@+id/et"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="请输入图片路径" /><!-- 提示 -->
<Button
android:onClick="click"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="浏览图片"/>
</LinearLayout>
public class MainActivity extends Activity
{
private EditText et_path;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et_path =
(EditText) findViewById(R.id.et);
}
public void click(View
view)
{
SmartImageView siv = (SmartImageView) findViewById(R.id.siv);
siv.setImageUrl(et_path.getText().toString().trim(),
R.drawable.ic_launcher,
R.drawable.ic_launcher);
}
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
Android项目——网络图片查看器的更多相关文章
- Android smartimageview网络图片查看器
调用代码: SmartImageView siv = (SmartImageView) findViewById(R.id.siv);siv.setImageUrl(et_path.getText() ...
- Android 网络图片查看器
今天来实现一下android下的一款简单的网络图片查看器 界面如下: 代码如下: <LinearLayout xmlns:android="http://schemas.android ...
- 无废话Android之内容观察者ContentObserver、获取和保存系统的联系人信息、网络图片查看器、网络html查看器、使用异步框架Android-Async-Http(4)
1.内容观察者ContentObserver 如果ContentProvider的访问者需要知道ContentProvider中的数据发生了变化,可以在ContentProvider 发生数据变化时调 ...
- android 网络_网络图片查看器
xml <?xml version="1.0"?> -<LinearLayout tools:context=".MainActivity" ...
- Android -- 网络图片查看器,网络html查看器, 消息机制, 消息队列,线程间通讯
1. 原理图 2. 示例代码 (网络图片查看器) (1) HttpURLConnection (2) SmartImageView (开源框架:https://github.com/loopj/an ...
- Android 网络图片查看器与网页源码查看器
在AndroidManifest.xml里面先添加访问网络的权限: <uses-permission android:name="android.permission.INTERNET ...
- 黎活明8天快速掌握android视频教程--23_网络通信之网络图片查看器
1.首先新建立一个java web项目的工程.使用的是myeclipe开发软件 图片的下载路径是http://192.168.1.103:8080/lihuoming_23/3.png 当前手机和电脑 ...
- Android 网络HTML查看器
本文实现一个基于Android的网络HTML查看器 新建项目,项目布局文件如下: <LinearLayout xmlns:android="http://schemas.android ...
- Android简易实战教程--第二十六话《网络图片查看器在本地缓存》
本篇接第二十五话 点击打开链接 http://blog.csdn.net/qq_32059827/article/details/52389856 上一篇已经把王略中的图片获取到了.生活中有这么 ...
随机推荐
- android 定时器的使用
1.android中通常是使用AlarmManager来定时启动一个单次或重复多次操作的.具体的说就是我们通过AlarmManager设定一个时间和注册一个intent到系统中,然后在该时间到来时,系 ...
- cvWaitKey
OpenCV中的一个函数 函数原型为: C++: int waitKey(int delay=0) Python: cv2.waitKey([delay]) → retval C: int cvWai ...
- eclipse 工程乱码问题
一 设置工作空间的编码格式(对新建的工程有效) window-->preference-->Gerneral-->Workspace-->Text file coding--- ...
- JAVA工作方式
public class Hellow { int eyes = 2; int ears = 2; int legs = 4; void run(){ //方法 System.out.println( ...
- UIViewController
UIViewController 在MVC模式中就是C.关于MVC,可以看 UIViewController 主要具有什么功能呢? View Management When you define a ...
- 控制台应用程序中Main函数的args参数
在VS中添加参数 菜单 项目 -- 你的项目属性 -- 调试 -- 启动选项 -- 命令行参数 参数之间用空格分隔开就可以了,如果参数有空格,以双引号风格
- 想调试,装了个Zend Server
本来apache+mysql+php+zend studio+ svn + ftp +ssh跑的挺好,总想跑个断点调个程序能爽些,白瞎这么强的GUI集成开发环境,只能System.out.printl ...
- iOS App 转移
此文章只是为了记录一个Apple ID下的APP,转移到另外一个Apple ID 账户下.为了说的清楚下面用A账户(有App,要转出去)B账户(接收A账户App,接收者),来说明. 1. 登 ...
- iOS:音频
ios中有很多支持音频的控件,如:播放本地音乐(file URL)的AVAudioPlayer和AudioToolbox.Framework.可以播放音乐库音乐的MPMusicPlayerContro ...
- IOS 作业项目(2) 画图(保存,撤销,笔粗细设定功能)
先上效果图