• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java UIColor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.robovm.apple.uikit.UIColor的典型用法代码示例。如果您正苦于以下问题:Java UIColor类的具体用法?Java UIColor怎么用?Java UIColor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UIColor类属于org.robovm.apple.uikit包,在下文中一共展示了UIColor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: applyAttributes

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static void applyAttributes(UISearchBar searchBar, Map<String, String> attrs, NSObject actionTarget) {
    UIViewLayoutUtil.applyAttributes(searchBar, attrs);

    UIColor tintColor = ResourceAttributesUtil.getColorValue(attrs, "tintColor");
    if(tintColor != null) {
        searchBar.setTintColor(tintColor);
    }

    String barStyle = attrs.get("barStyle");
    if(barStyle != null) {
        searchBar.setBarStyle(UIToolbarLayoutUtil.getBarStyleByAttribute(barStyle));
    }

    String translucent = attrs.get("translucent");
    if(translucent != null) {
        searchBar.setTranslucent(Boolean.parseBoolean(translucent));
    }
}
 
开发者ID:liraz,项目名称:robolayout,代码行数:19,代码来源:UISearchBarLayoutUtil.java


示例2: applyAttributes

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static void applyAttributes(UISwitch uiSwitch, Map<String, String> attrs, NSObject actionTarget) {
    UIControlLayoutUtil.applyAttributes(uiSwitch, attrs, actionTarget);

    UIColor tintColor = ResourceAttributesUtil.getColorValue(attrs, "tintColor");
    if(tintColor != null) {
        uiSwitch.setTintColor(tintColor);
    }
    UIColor onTintColor = ResourceAttributesUtil.getColorValue(attrs, "onTintColor");
    if(tintColor != null) {
        uiSwitch.setOnTintColor(onTintColor);
    }
    UIColor thumbTintColor = ResourceAttributesUtil.getColorValue(attrs, "thumbTintColor");
    if(tintColor != null) {
        uiSwitch.setThumbTintColor(thumbTintColor);
    }

    String isOn = attrs.get("isOn");
    if(isOn != null) {
        uiSwitch.setOn(Boolean.parseBoolean(isOn));
    }
}
 
开发者ID:liraz,项目名称:robolayout,代码行数:22,代码来源:UISwitchLayoutUtil.java


示例3: applyAttributes

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static void applyAttributes(UIToolbar toolbar, Map<String, String> attrs, NSObject actionTarget) {
    UIViewLayoutUtil.applyAttributes(toolbar, attrs);

    UIColor tintColor = ResourceAttributesUtil.getColorValue(attrs, "tintColor");
    if(tintColor != null) {
        toolbar.setTintColor(tintColor);
    }

    String barStyle = attrs.get("barStyle");
    if(barStyle != null) {
        toolbar.setBarStyle(UIToolbarLayoutUtil.getBarStyleByAttribute(barStyle));
    }

    String translucent = attrs.get("translucent");
    if(translucent != null) {
        toolbar.setTranslucent(Boolean.parseBoolean(translucent));
    }
}
 
开发者ID:liraz,项目名称:robolayout,代码行数:19,代码来源:UIToolbarLayoutUtil.java


示例4: MyViewController

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public MyViewController() {
    // Get the view of this view controller.
    UIView view = getView();

    // Setup background.
    view.setBackgroundColor(UIColor.white());

    // Setup label.
    label = new UILabel(new CGRect(20, 250, 280, 44));
    label.setFont(UIFont.getSystemFont(24));
    label.setTextAlignment(NSTextAlignment.Center);
    view.addSubview(label);

    // Setup button.
    button = new UIButton(UIButtonType.RoundedRect);
    button.setFrame(new CGRect(110, 150, 100, 40));
    button.setTitle("Click me!", UIControlState.Normal);
    button.getTitleLabel().setFont(UIFont.getBoldSystemFont(22));

    button.addOnTouchUpInsideListener((control, event) -> label.setText("Click Nr. " + (++clickCount)));
    view.addSubview(button);
}
 
开发者ID:robovm,项目名称:robovm-templates,代码行数:23,代码来源:MyViewController.java


示例5: setContentOfCell

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static UITableViewCell setContentOfCell(String name, NSURL url, String adresse, String email) {
	UITableViewCell cell = new UITableViewCell(new CGRect(0, 0, 300, 60));
	UIImageView img = new UIImageView(new CGRect(20, 10, 70, 70));
	NSData data = (NSData)NSData.read(url);
	img.setImage(new UIImage(data));		
	cell.getContentView().addSubview(img);
	
	UILabel label1 = new UILabel(new CGRect(100, 10, cell.getContentView().getFrame().getWidth(), 20));
	label1.setText(name);
	label1.setTextColor(UIColor.colorBrown());
	cell.getContentView().addSubview(label1);
	
	UILabel label2 = new UILabel(new CGRect(100, 35, cell.getContentView().getFrame().getWidth(), 20));
	label2.setText(adresse);
	cell.getContentView().addSubview(label2);
	
	UILabel label3 = new UILabel(new CGRect(100, 55, cell.getContentView().getFrame().getWidth(), 20));
	label3.setText(email);
	cell.getContentView().addSubview(label3);
	return cell;
}
 
开发者ID:Kourtessia,项目名称:RoboVM-for-iOS,代码行数:22,代码来源:AddressbookUtils.java


示例6: didFinishLaunching

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application,
		NSDictionary<NSString, ?> launchOptions) {
	
	window = new UIWindow(UIScreen.getMainScreen().getBounds());

	GenderListTableViewController genderListTableViewController = new GenderListTableViewController();
	UINavigationController navigationController = new UINavigationController(genderListTableViewController);
	navigationController.addStrongRef(genderListTableViewController);
	navigationController.setDelegate(new UINavigationControllerDelegateAdapter() {});
	window.setRootViewController(navigationController);
	window.setBackgroundColor(UIColor.colorWhite());
	window.makeKeyAndVisible();

	return true;
}
 
开发者ID:Kourtessia,项目名称:RoboVM-for-iOS,代码行数:17,代码来源:RoboVMTableViewApplicationDelegate.java


示例7: PAPActivityCell

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public PAPActivityCell(UITableViewCellStyle style, String reuseIdentifier) {
    super(style, reuseIdentifier);

    horizontalTextSpace = getHorizontalTextSpaceForInsetWidth(0);

    // Create subviews and set cell properties
    setOpaque(true);
    setSelectionStyle(UITableViewCellSelectionStyle.None);
    setAccessoryType(UITableViewCellAccessoryType.None);

    activityImageView = new PAPProfileImageView();
    activityImageView.setBackgroundColor(UIColor.clear());
    activityImageView.setOpaque(true);
    mainView.addSubview(activityImageView);

    activityImageButton = new UIButton(UIButtonType.Custom);
    activityImageButton.setBackgroundColor(UIColor.clear());
    activityImageButton.addOnTouchUpInsideListener(didTapActivityButton);
    mainView.addSubview(activityImageButton);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:PAPActivityCell.java


示例8: PAPPhotoCell

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public PAPPhotoCell(UITableViewCellStyle style, String reuseIdentifier) {
    super(style, reuseIdentifier);

    setOpaque(false);
    setSelectionStyle(UITableViewCellSelectionStyle.None);
    setAccessoryType(UITableViewCellAccessoryType.None);
    setClipsToBounds(false);

    setBackgroundColor(UIColor.clear());

    getImageView().setFrame(new CGRect(0, 0, getBounds().getWidth(), getBounds().getWidth()));
    getImageView().setBackgroundColor(UIColor.black());
    getImageView().setContentMode(UIViewContentMode.ScaleAspectFit);

    photoButton = new UIButton(UIButtonType.Custom);
    photoButton.setFrame(new CGRect(0, 0, getBounds().getWidth(), getBounds().getWidth()));
    photoButton.setBackgroundColor(UIColor.clear());
    getContentView().addSubview(photoButton);

    getContentView().bringSubviewToFront(getImageView());
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:22,代码来源:PAPPhotoCell.java


示例9: PAPLoadMoreCell

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public PAPLoadMoreCell(UITableViewCellStyle style, String reuseIdentifier) {
    super(style, reuseIdentifier);

    setOpaque(false);
    setSelectionStyle(UITableViewCellSelectionStyle.None);
    setAccessoryType(UITableViewCellAccessoryType.None);
    setBackgroundColor(UIColor.clear());

    mainView = new UIView(getContentView().getFrame());
    if (reuseIdentifier.equals("NextPageDetails")) {
        mainView.setBackgroundColor(UIColor.white());
    } else {
        mainView.setBackgroundColor(UIColor.black());
    }

    loadMoreImageView = new UIImageView(UIImage.getImage("CellLoadMore"));
    mainView.addSubview(loadMoreImageView);

    getContentView().addSubview(mainView);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:PAPLoadMoreCell.java


示例10: getCellForNextPage

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
@Override
public PFTableViewCell getCellForNextPage(UITableView tableView, NSIndexPath indexPath) {
    final String cellID = "NextPageCell";

    PAPLoadMoreCell cell = (PAPLoadMoreCell) tableView.dequeueReusableCell(cellID);

    if (cell == null) {
        cell = new PAPLoadMoreCell(UITableViewCellStyle.Default, cellID);
        cell.getMainView().setBackgroundColor(UIColor.black());
        cell.setHideSeparatorBottom(true);
        cell.setHideSeparatorTop(true);
    }

    cell.setSelectionStyle(UITableViewCellSelectionStyle.None);

    return cell;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:PAPFindFriendsViewController.java


示例11: applyTintEffect

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static UIImage applyTintEffect(UIImage image, UIColor tintColor) {
    final double effectColorAlpha = 0.6;
    UIColor effectColor = tintColor;
    long componentCount = tintColor.getCGColor().getNumberOfComponents();
    if (componentCount == 2) {
        double[] b = tintColor.getWhiteAlpha();
        if (b != null) {
            effectColor = UIColor.fromWhiteAlpha(b[0], effectColorAlpha);
        }
    } else {
        double[] rgba = tintColor.getRGBA();
        if (rgba != null) {
            effectColor = UIColor.fromRGBA(rgba[0], rgba[1], rgba[2], effectColorAlpha);
        }
    }
    return applyBlur(image, 10, effectColor, -1, null);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:UIImageEffects.java


示例12: newBorderMask

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
/**
 * 
 * @param borderSize
 * @param size
 * @return a mask that makes the outer edges transparent and everything else
 *         opaque The size must include the entire mask (opaque part +
 *         transparent border)
 */
private static CGImage newBorderMask(int borderSize, CGSize size) {
    CGColorSpace colorSpace = CGColorSpace.createDeviceGray();

    // Build a context that's the same dimensions as the new size
    CGBitmapContext maskContext = CGBitmapContext.create((long) size.getWidth(), (long) size.getHeight(), 8, 0,
            colorSpace, new CGBitmapInfo(CGBitmapInfo.ByteOrderDefault.value() | CGImageAlphaInfo.None.value())); // TODO
    // easier

    // Start with a mask that's entirely transparent
    maskContext.setFillColor(UIColor.black().getCGColor());
    maskContext.fillRect(new CGRect(0, 0, size.getWidth(), size.getHeight()));

    // Make the inner part (within the border) opaque
    maskContext.setFillColor(UIColor.white().getCGColor());
    maskContext.fillRect(new CGRect(borderSize, borderSize, size.getWidth() - borderSize * 2, size.getHeight()
            - borderSize * 2));

    // Get an image of the context
    CGImage maskImage = maskContext.toImage();

    return maskImage;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:31,代码来源:UIImageUtility.java


示例13: drawSideAndBottomDropShadow

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static void drawSideAndBottomDropShadow(CGRect rect, CGContext context) {
    // Push the context
    context.saveGState();

    // Set the clipping path to remove the rect drawn by drawing the shadow
    CGRect boundingRect = context.getClipBoundingBox();
    context.addRect(boundingRect);
    context.addRect(rect);
    context.clip();
    // Also clip the top and bottom
    context.clipToRect(new CGRect(rect.getOrigin().getX() - 10, rect.getOrigin().getY(),
            rect.getSize().getWidth() + 20, rect.getSize().getHeight() + 10));

    // Draw shadow
    UIColor.black().setFill();
    context.setShadow(CGSize.Zero(), 7);
    context.fillRect(new CGRect(rect.getOrigin().getX(), rect.getOrigin().getY() - 5, rect.getSize().getWidth(),
            rect.getSize().getHeight() + 5));

    // Save context
    context.restoreGState();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:23,代码来源:PAPUtility.java


示例14: drawSideAndTopDropShadow

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static void drawSideAndTopDropShadow(CGRect rect, CGContext context) {
    // Push the context
    context.saveGState();

    // Set the clipping path to remove the rect drawn by drawing the shadow
    CGRect boundingRect = context.getClipBoundingBox();
    context.addRect(boundingRect);
    context.addRect(rect);
    context.clip();
    // Also clip the top and bottom
    context.clipToRect(new CGRect(rect.getOrigin().getX() - 10, rect.getOrigin().getY() - 10, rect.getSize()
            .getWidth() + 20, rect.getSize().getHeight() + 10));

    // Draw shadow
    UIColor.black().setFill();
    context.setShadow(CGSize.Zero(), 7);
    context.fillRect(new CGRect(rect.getOrigin().getX(), rect.getOrigin().getY(), rect.getSize().getWidth(), rect
            .getSize().getHeight() + 10));

    // Save context
    context.restoreGState();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:23,代码来源:PAPUtility.java


示例15: drawSideDropShadow

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static void drawSideDropShadow(CGRect rect, CGContext context) {
    // Push the context
    context.saveGState();

    // Set the clipping path to remove the rect drawn by drawing the shadow
    CGRect boundingRect = context.getClipBoundingBox();
    context.addRect(boundingRect);
    context.addRect(rect);
    context.clip();
    // Also clip the top and bottom
    context.clipToRect(new CGRect(rect.getOrigin().getX() - 10, rect.getOrigin().getY(),
            rect.getSize().getWidth() + 20, rect.getSize().getHeight()));

    // Draw shadow
    UIColor.black().setFill();
    context.setShadow(CGSize.Zero(), 7);
    context.fillRect(new CGRect(rect.getOrigin().getX(), rect.getOrigin().getY() - 5, rect.getSize().getWidth(),
            rect.getSize().getHeight() + 10));

    // Save context
    context.restoreGState();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:23,代码来源:PAPUtility.java


示例16: setupAppearance

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
private void setupAppearance() {
    UIApplication.getSharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent);

    UINavigationBar navigationBarAppearance = UIAppearance.getAppearance(UINavigationBar.class);
    navigationBarAppearance.setTintColor(UIColor.fromRGBA(254f / 255f, 149f / 255f, 50f / 255f, 1));
    navigationBarAppearance.setBarTintColor(UIColor.fromRGBA(0, 0, 0, 1));
    navigationBarAppearance.setTitleTextAttributes(new NSAttributedStringAttributes().setForegroundColor(UIColor
            .white()));

    UIButton buttonAppearance = UIAppearance.getAppearance(UIButton.class, UINavigationBar.class);
    buttonAppearance
            .setTitleColor(UIColor.fromRGBA(254f / 255f, 149f / 255f, 50f / 255f, 1), UIControlState.Normal);

    UIBarButtonItem barButtonItemAppearance = UIAppearance.getAppearance(UIBarButtonItem.class);
    barButtonItemAppearance.setTitleTextAttributes(new NSAttributedStringAttributes().setForegroundColor(
            UIColor.fromRGBA(254f / 255f, 149f / 255f, 50f / 255f, 1)), UIControlState.Normal);

    UISearchBar searchBarAppearance = UIAppearance.getAppearance(UISearchBar.class);
    searchBarAppearance.setTintColor(UIColor.fromRGBA(254f / 255f, 149f / 255f, 50f / 255f, 1));
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:AnyPicApp.java


示例17: didFinishLaunching

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    window.setBackgroundColor(UIColor.white());
    /* Setup a tab bar controller that handles our custom view controllers */
    tabBarController = new UITabBarController();
    tabBarController.addChildViewController(new MyStreamingMovieViewController());
    tabBarController.addChildViewController(new MyLocalMovieViewController());

    /* Set the tab bar controller as the root of our window. */
    window.setRootViewController(tabBarController);
    window.makeKeyAndVisible();

    /*
     * Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
     * early.
     */
    addStrongRef(window);

    return true;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:22,代码来源:MoviePlayer.java


示例18: AtomicElementView

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public AtomicElementView(CGRect frame) {
    super(frame);
    // set the background color of the view to clear
    setBackgroundColor(UIColor.clear());

    // attach a tap gesture recognizer to this view so it can flip
    UITapGestureRecognizer tapGestureRecognizer = new UITapGestureRecognizer(
            new UIGestureRecognizer.OnGestureListener() {
                @Override
                public void onGesture(UIGestureRecognizer gestureRecognizer) {
                    // when a tap gesture occurs tell the view controller to
                    // flip this view to the
                    // back and show the AtomicElementFlippedView instead
                    viewController.flipCurrentView();
                }
            });
    addGestureRecognizer(tapGestureRecognizer);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:19,代码来源:AtomicElementView.java


示例19: draw

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
@Override
public void draw(CGRect rect) {
    // draw a rounded rect bezier path filled with blue
    CGContext context = UIGraphics.getCurrentContext();
    context.saveGState();

    UIBezierPath bezierPath = UIBezierPath.newRoundedRect(rect, 5);
    bezierPath.setLineWidth(5);
    UIColor.black().setStroke();

    UIColor fillColor = UIColor.fromRGBA(0.529, 0.808, 0.922, 1); // #87ceeb

    fillColor.setFill();

    bezierPath.stroke();
    bezierPath.fill();

    context.restoreGState();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:CustomCellBackground.java


示例20: loadSharedAssets

import org.robovm.apple.uikit.UIColor; //导入依赖的package包/类
public static void loadSharedAssets() {
    // Load only once.
    if (sharedDamageEmitter == null) {
        sharedIdleAnimationFrames = APAUtils.loadFramesFromAtlas("Boss/Boss_Idle", "boss_idle_", IDLE_FRAMES);
        sharedWalkAnimationFrames = APAUtils.loadFramesFromAtlas("Boss/Boss_Walk", "boss_walk_", WALK_FRAMES);
        sharedAttackAnimationFrames = APAUtils.loadFramesFromAtlas("Boss/Boss_Attack", "boss_attack_",
                ATTACK_FRAMES);
        sharedGetHitAnimationFrames = APAUtils.loadFramesFromAtlas("Boss/Boss_GetHit", "boss_getHit_",
                GET_HIT_FRAMES);
        sharedDeathAnimationFrames = APAUtils.loadFramesFromAtlas("Boss/Boss_Death", "boss_death_", DEATH_FRAMES);

        sharedDamageEmitter = APAUtils.getEmitterNodeByName("BossDamage");
        sharedDamageAction = SKAction.sequence(new NSArray<SKAction>(SKAction.colorize(UIColor.white(), 1.0, 0.0),
                SKAction
                        .wait(0.5), SKAction.colorize(0.0, 0.1)));
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:APABoss.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MIMEEntity类代码示例发布时间:2022-05-22
下一篇:
Java Status类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap