效果-=--------------》
加入包




<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);

}

}

版权声明:本文为博主原创文章,未经博主允许不得转载。

最新文章

  1. 基于ACE的c++线程封装
  2. The server encountered an internal error that prevented it from fulfilling this request.
  3. MVC学习笔记---ModelBinder
  4. 设计模式之美:Flyweight(享元)
  5. AppStore 相关
  6. csharp: 用Enterprise Library对象实体绑定数据
  7. 20145324 20145325《信息安全系统设计基础》实验五 简单嵌入式WEB服务器实验
  8. HBase的shell命令行界面按退格键(Backspace)无法删除问题
  9. C/C++指针和数组的关系
  10. MVC-03 控制器(5)
  11. PIL Gif分割成多个图片
  12. SourceTree 简单使用 for Mac
  13. Python+Requests接口测试教程(1):Fiddler抓包工具
  14. web开发 c/s结构 和 b/s结构
  15. ArcGIS API for JavaScript 入门教程[5] 再讲数据——Map类之底图与高程
  16. 理解滑动平均(exponential moving average)
  17. Ubuntu ARM更改为国内源
  18. 谷歌浏览器把网页打印成pdf
  19. Dapper - .Net 环境下一个简单对象映射的框架
  20. vs中 main和_tmain的区别

热门文章

  1. SharePoint 2013 Nintex Workflow 工作流帮助(十三)
  2. Python单元测试——unittest
  3. Asp.Net应用运行原理
  4. Connection to http://www.google.com:80 refused
  5. 如何通过 GT 快速开始性能测试?
  6. ios开发之触碰动画效果
  7. php大力力 [023节]CREATE TABLE创建新表sql写字段备注(2015-08-27)
  8. ACDream-C - Transformers&#39; Mission(Dijastra最短路径)
  9. (Your)((Term)((Project)))
  10. JS手机定位地理位置