android-smart-image-view-master 用于加载图片
利用smart-image-view-master能很容易的查看一个网络上面图片
SmartImageView smart=(SmartImageView) findViewById(R.id.smarImageViewId);
smart.setImageUrl("http://10.140.0.89:8080/img/a.png", R.drawable.ic_launcher);
图片加载内部封装好的
<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);
}
}
android-smart-image-view-master 用于加载图片
利用smart-image-view-master能很容易的查看一个网络上面图片
SmartImageView smart=(SmartImageView) findViewById(R.id.smarImageViewId);
smart.setImageUrl("http://10.140.0.89:8080/img/a.png", R.drawable.ic_launcher);
图片加载内部封装好的
<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);
}
}