android:drawableTop="@drawable/img1";上下左右在xml中控制

 

=============================================================

  show = (Button) findViewById(R.id.show);
  
  
  // 在Android中显示图片信息,必须使用Bitmap
  Bitmap bitmapL = BitmapFactory.decodeResource(getResources(),
    R.drawable.img1);

  ImageSpan imageSpanL = new ImageSpan(bitmapL,DynamicDrawableSpan.ALIGN_BOTTOM);

  SpannableString ssL = new SpannableString("img");

  ssL.setSpan(imageSpanL, 0, 3,
    SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
  
  Bitmap bitmapR = BitmapFactory.decodeResource(getResources(),
    R.drawable.img1);

  ImageSpan imageSpanR = new ImageSpan( bitmapR,DynamicDrawableSpan.ALIGN_BOTTOM);

  SpannableString ssR = new SpannableString("img");

  ssR.setSpan(imageSpanR, 0, 3,
    SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
  
  show.append(ssL);
  show.append("zhongjian");
  show.append(ssR);

 

更多相关文章

  1. android之Display.getRotation()_传感器控制屏幕旋转
  2. Android链式方法显示Dialog
  3. android中使用local_manifest.xml添加软件
  4. [置顶] androidの下拉菜单Spinner使用
  5. Android版本28使用http请求报错not permitted by network securi
  6. Android如何在xml布局中使用自定义属性
  7. Android(安卓)OneDayOneExample-2. 读取电话本
  8. android getIdentifier的使用
  9. android SpannableString使用详解

随机推荐

  1. android获取屏幕相关信息
  2. Android(安卓)Bluetooth使用详解
  3. android 学习视频汇总
  4. 插画人物的光影怎么画?零基础绘画光影教程
  5. Linux-安装ifconfig
  6. 如何练习画线稿?初学者画线稿步骤
  7. 解决:Failed to download metadata for re
  8. PHP最新的插件化后台管理系统真的蛮好用
  9. 如何绘制手部?漫画人物手部简单画法
  10. Android屏蔽HOME键