Tag: uibutton

UIButton中的animation图像

什么是animationbutton的图像的最佳方式? 假设我想像6帧一样循环,并让用户仍然可以点击button? 我应该animation的图像,只是在界面build设者的顶部有一个不可见的button? 有没有一种方法来定义UIButtonanimation呢? 或者是更好的animation图像,并find用户的接触点,并采取行动?

UIImageView内的UIButton不响应水龙头

我有一个滚动视图,其中有一个图像作为子视图的图像视图,图像视图有一个UIButton作为其子视图之一。 问题是,我无法点击button。 我可以看到button,但我不能点击它。 有人能告诉我什么是我搞砸了吗? 任何帮助是极大的赞赏! 谢谢! 以下是代码: scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"img.jpg"]]; scrollView.delegate = self; self.view = scrollView; // add invisible buttons [self addInvisibleButtons]; [scrollView addSubview:imageView]; addInvisibleButtons具有以下代码: UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(buttonHandler) forControlEvents:UIControlEventAllEvents]; [button setTitle:@"point" forState:UIControlStateNormal]; button.frame = CGRectMake(0.0, 0.0, 40.0, 40.0); [self.imageView addSubview:button];

UIModalTransitionStylePartialCurl导致UIButton文字animation

我有一个使用UIModalTransitionStylePartialCurl转换样式的模式视图中使用的UIView。 这个UIView包含一个UIButton。 奇怪的是,每当视图出现时,当主页面向上剥离到窗口顶部时,模式视图上的button就会自动生成animation,并且文本看起来会从其中心键入到button上。 这个animation的动作有点分散注意力。 为什么会这样呢? 有什么办法来防止它? UIButton确实使用了自定义的背景,但是在XIB中为模态视图定义了它,并且不使用我自己的任何特殊的子类。 这是一个标准的button。

UIButton按住动作和释放动作

我想创build一个可以按下的UIButton,当它按下时,它会调用一次“hold down”操作。 当它被释放时,调用“暂停释放”动作。 此代码无法正常工作,因为触摸可以在button内移动,并且事件不会以正确的顺序触发 [button handleControlEvent:UIControlEventTouchDown withBlock:^{ [self performMomentaryAction:PXActionTypeTouchDown]; }]; [button handleControlEvent:UIControlEventTouchUpInside withBlock:^{ [self performMomentaryAction:PXActionTypeTouchUp]; }]; 句柄控制事件是基于UIButton +模块实现的

检测用UIButton数组按下哪个button

我有一个像这样的UIButton数组: @property (nonatomic, retain) IBOutletCollection(UIButton) NSArray *btn_Impact_Collection; 我有这个function: – (IBAction)impactAction:(id)sender; 在XIB文件中,我有九个button,每个button都通过引用出口集合连接到btn_Impact_Collection数组。 此外,每个button的Touch_inside属性连接到函数ImpactAction。 现在,当点击一个button时,ImpactAction函数被调用,但是在这个函数里面,我怎么知道哪个button被按下? 在此先感谢您的答案!

UIScrollView的iOS5 UITapRecognizer干扰button。 怎么修?

我有UIScrollView UIView内的一堆UIButton 。 我正在试图添加一个水龙头识别器的滚动视图。 轻拍识别器触发,但现在我的button没有任何工作。 我知道,在iOS5中, UIScrollView可以以某种方式将触摸事件传递给控制层次。 任何人都可以帮我弄清楚如何做到这一点?

UISearchbar的取消button的图像

可能重复: 在UISearchBar中设置取消button的样式 我试图为search栏设置图像,我可以使用search栏的子视图UISearchBarBackground来设置search栏的图像,但是我无法为search栏的取消button设置图像。 我得到的search栏子视图UINavigationButton的button,但我知道如何设置UINavigationButton图像。 谁能帮我? 先谢谢你

为什么自定义UIButton图像不能在Interface Builder中resize?

为什么自定义的UIButton图像不能用buttonresize? 我将其视图模式设置为缩放以填充界面生成器,但与UIImageView图像不同,它不尊重该设置。 我看错了地方还是不可能?

iOS – 将联系人添加到联系人?

Heyo! 有没有办法如何当用户点击一个button,它可以添加或更新联系人到实际的苹果通讯录? 一些节日有电子邮件回复,包括一个“名片”,接收者可以下载并在他们的联系簿中find。

UIButton的图像滚动与滚动视图,但其行动/方法保持原来的位置

我有一个自动滚动的UIScrollView,我使用initWithFrame创build了几个button,每个button都有一个图像和一个独特的动作(方法),并将它们全部添加到滚动视图中。 button的图像可以滚动自动滚动视图,但是当我点击每个button,这不是我分配给该button的方法。 当我点击相同的位置时,不pipe哪个button通过,它将采用相同的方法,而不是button的方法。 下面是我创buildbutton的代码: for (int i = 0; i < 4; i++) { //create an imageView object in every 'page' of the scrollView. CGRect frame; frame.origin.x = 62 * i; frame.origin.y = 0; frame.size = CGSizeMake(52.0, 52.0); myButton = [[UIButton alloc] initWithFrame:frame]; [myButton setImage:[MyImageArray objectAtIndex:i] forState:normal]; switch (i) { case 0: [myButton addTarget:self action:@selector(aMethod0) […]