android.widget.ImageView.setLeft()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中android.widget.ImageView.setLeft()方法的一些代码示例,展示了ImageView.setLeft()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setLeft()方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setLeft

ImageView.setLeft介绍

暂无

代码示例

代码示例来源:origin: andreadec/MusicPlayer

private void dragStart(float x, float y) {
  adapter = (MusicPlayerAdapter)recyclerView.getAdapter();
  draggingView = recyclerView.findChildViewUnder(x, y);
  adjustY = (int)(y-draggingView.getTop());
  initialPosition = recyclerView.getChildPosition(draggingView);
  currentPosition = initialPosition;
  // Copy view to overlay
  Bitmap bitmap = Bitmap.createBitmap(draggingView.getWidth(), draggingView.getHeight(), Bitmap.Config.ARGB_8888);
  draggingView.draw(new Canvas(bitmap));
  overlay.setImageBitmap(bitmap);
  overlay.setTop(0);
  overlay.setLeft(0);
  overlay.setTranslationY(y-adjustY);
  overlay.setTranslationX(0);
  draggingView.setVisibility(View.INVISIBLE);
  initX = (int)x;
  initY = (int)y;
  actionInProgress = Action.ACTION_DECIDING;
}

代码示例来源:origin: zoff99/ToxAndroidRefImpl

@Override
public boolean onTouch(View arg0, MotionEvent e)
{
  try
  {
    int action = e.getAction();
    if (action == MotionEvent.ACTION_DOWN)
    {
      bug_button.setLeft(bug_button.getLeft() + 10);
      bug_button.setTop(bug_button.getTop() + 10);
      return true;
    }
    else
    {
      if (action == MotionEvent.ACTION_UP)
      {
        bug_button.setLeft(bug_button.getLeft() - 10);
        bug_button.setTop(bug_button.getTop() - 10);
        restart_app();
        finish();
        return true;
      }
    }
  }
  catch (Exception ex)
  {
    ex.printStackTrace();
  }
  return false;
}

代码示例来源:origin: stackoverflow.com

knight.setLeft(knight.getLeft() - speed);

代码示例来源:origin: cloudinary/cloudinary_android

/**
 * Helper method to get an imageview with the given dimensions
 */
private ImageView getImageView(int width, int height) {
  ImageView imageView = new ImageView(InstrumentationRegistry.getContext());
  imageView.setLeft(0);
  imageView.setRight(width);
  imageView.setTop(0);
  imageView.setBottom(height);
  return imageView;
}

相关文章

ImageView类方法