本文整理了Java中android.widget.ScrollView.getWidth()
方法的一些代码示例,展示了ScrollView.getWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollView.getWidth()
方法的具体详情如下:
包路径:android.widget.ScrollView
类名称:ScrollView
方法名:getWidth
暂无
代码示例来源:origin: stackoverflow.com
@Override
protected void onStart() {
super.onStart();
ScrollView scrollView = (ScrollView) findViewById(R.id.svtest);
int width = scrollView.getWidth();
int height = scrollView.getHeight();
}
代码示例来源:origin: stackoverflow.com
public void onWindowFocusChanged (boolean hasFocus)
{
super.onWindowFocusChanged(hasFocus);
ScrollView scrollView = (ScrollView) findViewById(R.id.svtest);
int width = scrollView.getWidth();
int height = scrollView.getHeight();
}
代码示例来源:origin: wallabag/android-app
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
if(!tapToScroll) return false;
if(e.getPointerCount() > 1) return false;
int viewHeight = scrollView.getHeight();
float y = e.getY() - scrollView.getScrollY();
if(y > viewHeight * 0.25 && y < viewHeight * 0.75) {
int viewWidth = scrollView.getWidth();
float x = e.getX();
if(x < viewWidth * 0.3) { // left part
scroll(true, screenScrollingPercent, smoothScrolling, false);
} else if(x > viewWidth * 0.7) { // right part
scroll(false, screenScrollingPercent, smoothScrolling, false);
}
}
return false;
}
};
代码示例来源:origin: luhaoaimama1/zone-sdk
/**
* 截取scrollview的屏幕
**/
public static Bitmap getBitmapByScrollView(ScrollView scrollView) {
int h = 0;
Bitmap bitmap = null;
// 获取listView实际高度
for (int i = 0; i < scrollView.getChildCount(); i++)
h += scrollView.getChildAt(i).getHeight();
Log.d(TAG, "实际高度:" + h);
Log.d(TAG, " 高度:" + scrollView.getHeight());
// 创建对应大小的bitmap
bitmap = Bitmap.createBitmap(scrollView.getWidth(), h,
Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(bitmap);
scrollView.draw(canvas);
return bitmap;
}
代码示例来源:origin: youxin11544/RxJava_Simple
/**
* 截取scrollview的屏幕
*
* @param scrollView
* @return
*/
public static Bitmap getBitmapByView(ScrollView scrollView) {
int h = 0;
Bitmap bitmap = null;
// 获取scrollview实际高度
for (int i = 0; i < scrollView.getChildCount(); i++) {
h += scrollView.getChildAt(i).getHeight();
// scrollView.getChildAt(i).setBackgroundColor(olor.parseColor("#ffffff"));
}
// 创建对应大小的bitmap
bitmap = Bitmap.createBitmap(scrollView.getWidth(), h, Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(bitmap);
scrollView.draw(canvas);
return bitmap;
}
代码示例来源:origin: 18Gray/CommonUtils
/**
* ScrollView截屏
* @param scrollView
* @param activity
* @param fileName
* @return
*/
public static Bitmap screenShotScrollView(ScrollView scrollView, Activity activity, String fileName)
{
int h = 0;
Bitmap bitmap = null;
// 获取scrollView实际高度
for (int i = 0; i < scrollView.getChildCount(); i++)
{
h += scrollView.getChildAt(i).getHeight();
}
// 创建对应大小的bitmap
bitmap = Bitmap.createBitmap(scrollView.getWidth(), h, Config.ARGB_8888);
final Canvas canvas = new Canvas(bitmap);
scrollView.draw(canvas);
return bitmap;
}
代码示例来源:origin: Luolc/LiteSyllabusView
Bitmap bitmap = Bitmap.createBitmap(scrollView.getWidth(), height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
scrollView.draw(canvas);
代码示例来源:origin: stackoverflow.com
bitmap = Bitmap.createBitmap(scrollView.getWidth(), h,
Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(bitmap);
代码示例来源:origin: Calsign/APDE
int h = bitmap.getHeight();
int dim = changeIconLayout.getWidth();
代码示例来源:origin: blurpy/kouchat-android
private static Rect getVisibleScrollArea(final ScrollView scrollView) {
final int[] locationOnScreen = new int[2];
scrollView.getLocationOnScreen(locationOnScreen);
return new Rect(
locationOnScreen[0], // left position
locationOnScreen[1], // top position
locationOnScreen[0] + scrollView.getWidth(), // right position
locationOnScreen[1] + scrollView.getHeight()); // bottom position
}
代码示例来源:origin: billthefarmer/editor
int width = scrollView.getWidth();
代码示例来源:origin: billthefarmer/editor
int width = scrollView.getWidth();
内容来源于网络,如有侵权,请联系作者删除!