当前位置: 首页>>代码示例>>Java>>正文


Java CGRect.Zero方法代码示例

本文整理汇总了Java中org.robovm.apple.coregraphics.CGRect.Zero方法的典型用法代码示例。如果您正苦于以下问题:Java CGRect.Zero方法的具体用法?Java CGRect.Zero怎么用?Java CGRect.Zero使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.robovm.apple.coregraphics.CGRect的用法示例。


在下文中一共展示了CGRect.Zero方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawInContext

import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
public void drawInContext(CGContext context) {
    BitmapDrawableConstantState state = this.internalConstantState;
    CGRect containerRect = this.getBounds();
    CGRect dstRect = CGRect.Zero();

    UIImage image = state.getImage();

    Gravity.applyGravity(state.getGravity(), image.getSize().getWidth(), image.getSize().getHeight(), containerRect, dstRect);

    if(scaledImageCache == null) {
        //self.scaledImageCache = [self resizeImage:image toWidth:dstRect.size.width height:dstRect.size.height];
    }
    UIGraphics.pushContext(context);
    //[self.scaledImageCache drawInRect:dstRect];
    image.draw(dstRect);

    UIGraphics.popContext();
}
 
开发者ID:liraz,项目名称:robolayout,代码行数:19,代码来源:BitmapDrawable.java

示例2: setContentSize

import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
private CGRect setContentSize(UITextView textView, UIScrollView scrollView) {
    CGRect currentRect = getSize(textView.getText());
    if (previousRect != CGRect.Zero()) {
        if (currentRect != previousRect) {
            textView.setFrame(currentRect);
            scrollView.setContentSize(currentRect.getSize());
        }
    }
    return currentRect;
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:11,代码来源:IOS_TextInputView.java

示例3: CollectionViewCell

import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
public CollectionViewCell(String resource) {
    super(CGRect.Zero());

    LayoutBridge bridge = new LayoutBridge(getContentView().getBounds());
    bridge.setAutoresizingMask(UIViewAutoresizing.FlexibleWidth.set(UIViewAutoresizing.FlexibleHeight));

    getContentView().addSubview(bridge);
    getContentView().setTranslatesAutoresizingMaskIntoConstraints(true);

    LayoutInflater inflater = new LayoutInflater();
    inflater.inflate(resource, bridge, true);

    layoutBridge = bridge;
}
 
开发者ID:liraz,项目名称:robolayout,代码行数:15,代码来源:CollectionViewCell.java

示例4: drawInContext

import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
public void drawInContext(CGContext context) {
    int level = this.getLevel();
    if(level > 0) {
        ClipDrawableConstantState state = internalConstantState;
        ClipDrawableOrientation orientation = state.getOrientation();

        CGRect r = CGRect.Zero();
        CGRect bounds = this.getBounds();

        double w = bounds.getSize().getWidth();
        double iw = 0; //mClipState.mDrawable.getIntrinsicWidth();

        if(orientation == ClipDrawableOrientation.Horizontal) {
            w -= (w - iw) * (10000 - level) / 10000;
        }

        double h = bounds.getSize().getHeight();
        double ih = 0; //mClipState.mDrawable.getIntrinsicHeight();

        if(orientation == ClipDrawableOrientation.Vertical) {
            h -= (h - ih) * (10000 - level) / 10000;
        }

        Gravity.applyGravity(state.getGravity(), w, h, bounds, r);

        if(w > 0 && h > 0) {
            context.saveGState();
            context.clipToRect(r);

            state.getDrawable().drawInContext(context);
            context.restoreGState();
        }
    }
}
 
开发者ID:liraz,项目名称:robolayout,代码行数:35,代码来源:ClipDrawable.java

示例5: createViewWithText

import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
private TextView createViewWithText(String text) {
    TextView view = new TextView(CGRect.Zero());
    view.setText(text);

    LinearLayoutLayoutParams layoutParams = new LinearLayoutLayoutParams(LayoutParamsSize.MatchParent, LayoutParamsSize.WrapContent);
    view.setLayoutParams(layoutParams);

    return view;
}
 
开发者ID:liraz,项目名称:robolayout,代码行数:10,代码来源:ViewGroupTest.java

示例6: Cell

import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
public Cell(CGRect frame) {
    super(frame);

    // change to our custom selected background view
    CustomCellBackground backgroundView = new CustomCellBackground(CGRect.Zero());
    setSelectedBackgroundView(backgroundView);

    image = new UIImageView(new CGRect(5, 6, 144, 105));
    addSubview(image);
    label = new UILabel(new CGRect(0, 109, 153, 18));
    label.setFont(UIFont.getSystemFont(12));
    label.setTextColor(UIColor.white());
    label.setTextAlignment(NSTextAlignment.Center);
    addSubview(label);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:16,代码来源:Cell.java

示例7: resetCachedAssets

import org.robovm.apple.coregraphics.CGRect; //导入方法依赖的package包/类
private void resetCachedAssets() {
    imageManager.stopCachingImagesForAllAssets();
    previousPreheatRect = CGRect.Zero();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:5,代码来源:AAPLAssetGridViewController.java


注:本文中的org.robovm.apple.coregraphics.CGRect.Zero方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。