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);
}
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
最新文章
- 基于ACE的c++线程封装
- The server encountered an internal error that prevented it from fulfilling this request.
- MVC学习笔记---ModelBinder
- 设计模式之美:Flyweight(享元)
- AppStore 相关
- csharp: 用Enterprise Library对象实体绑定数据
- 20145324 20145325《信息安全系统设计基础》实验五 简单嵌入式WEB服务器实验
- HBase的shell命令行界面按退格键(Backspace)无法删除问题
- C/C++指针和数组的关系
- MVC-03 控制器(5)
- PIL Gif分割成多个图片
- SourceTree 简单使用 for Mac
- Python+Requests接口测试教程(1):Fiddler抓包工具
- web开发 c/s结构 和 b/s结构
- ArcGIS API for JavaScript 入门教程[5] 再讲数据——Map类之底图与高程
- 理解滑动平均(exponential moving average)
- Ubuntu ARM更改为国内源
- 谷歌浏览器把网页打印成pdf
- Dapper - .Net 环境下一个简单对象映射的框架
- vs中 main和_tmain的区别
热门文章
- SharePoint 2013 Nintex Workflow 工作流帮助(十三)
- Python单元测试——unittest
- Asp.Net应用运行原理
- Connection to http://www.google.com:80 refused
- 如何通过 GT 快速开始性能测试?
- ios开发之触碰动画效果
- php大力力 [023节]CREATE TABLE创建新表sql写字段备注(2015-08-27)
- ACDream-C - Transformers&#39; Mission(Dijastra最短路径)
- (Your)((Term)((Project)))
- JS手机定位地理位置