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

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

2018-03-23 08:24 633 查看
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="打开图片"  
    />  

[java] view plain copypublic 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="打开图片"  
    />  

[java] view plain copypublic 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);  
          
          
    }  
      
      
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息