您的位置:首页 > 移动开发 > Android开发

android-smart-image-view-master开源框架的使用

2015-01-25 21:08 453 查看
利用smart-image-view-master能很容易的查看一个网络上面图片

<com.loopj.android.image.SmartImageView
android:layout_weight="1000"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/iv"

/>
<EditText
android:id="@+id/et"
android:singleLine="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="请输入网址"
android:text="http://img.uutuu.com/data6/a/ph/large/100402/78d0cf45d94b36fe134c037bfe9c8519.jpg?1270184574"

/>
<Button
android:onClick="play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="打开图片"
/>
public class MainActivity extends Activity {
private EditText  ed;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ed=(EditText)findViewById(R.id.et);
}

public void play(View view){
SmartImageView  iv=(SmartImageView)findViewById(R.id.iv);
iv.setImageUrl(ed.getText().toString(), R.drawable.ic_launcher, R.drawable.ic_launcher);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐