One, the button can not interact in several cases
1,alpha <= 0.01 (0.02 will be able to order)
2,hidden = YES
3, userinteraction = NO
4, where the parent view does not allow interaction, and the button cannot interact
5, you can interact within the visible range of the parent view, and parts beyond the scope cannot interact.
Second, the Uiimageview does not allow user interaction by default.
Third, disorderly order
-(void) randomoptions
{
The option array is out of order
[Self.options Sortedarrayusingcomparator:^nscomparisonresult (NSString *str1, NSString *str2) {
int seed = Arc4random_uniform (2);
if (seed) {
return [str1 COMPARE:STR2];
} else {
return [str2 COMPARE:STR1];
}
}];
}
Four, the model in order to disorderly, only in the time of loading to do a disorderly sequence.
-(Instancetype) Initwithdict: (Nsdictionary *) dict
{
if (self = [super init]) {
[Self setvaluesforkeyswithdictionary:dict];
Random Order of the alternate button, only one order at time of loading
[Self randomoptions];
}
return self;
}
Disorderly ordering outside of the model, each call will be a random order.
[Question Randomoptions];
V. Add masks
-(UIButton *) cover
{
if (_cover = = nil) {
Add Masks (Matte)
_cover = [[UIButton alloc] initWithFrame:self.view.bounds];
_cover.backgroundcolor = [Uicolor colorwithwhite:0.0 alpha:0.5];
[Self.view Addsubview:_cover];
[_cover addtarget:self Action: @selector (bigimage:) forcontrolevents:uicontroleventtouchupinside];
}
return _cover;
}
Add Masks (Matte)
UIButton *cover = [[UIButton alloc] initWithFrame:self.view.bounds];
//
Cover.backgroundcolor = [Uicolor colorwithwhite:0.0 alpha:0.5];
//
[Self.view Addsubview:cover];
//
[Cover addtarget:self action: @selector (smallimage:) forcontrolevents:uicontroleventtouchupinside];
}
Get the image in front of the mask
Bringsubviewtofront the child View Front
[Self.view BringSubviewToFront:self.iconButton];
Set the blur level of a mask
Self.cover.alpha = 0.0;
Self.cover.alpha = 1.0;
Vi. changing the color of the status bar
/**
* Adjust status bar color
Uistatusbarstyledefault = 0,//Dark content, for use in light backgrounds
Uistatusbarstylelightcontent Ns_enum_available_ios (7_0) = 1,//light content, for use on dark backgrounds
*/
-(Uistatusbarstyle) Preferredstatusbarstyle
{
return uistatusbarstylelightcontent;
}
Seven, wait some time to enter a method
[Self performselector: @selector (nextquestion:) Withobject:nil afterdelay:0.5];
Eight, TextField set the word limit
-(BOOL) TextField: (Uitextfield *) TextField Shouldchangecharactersinrange: (nsrange) range replacementstring: ( NSString *) string
{
int loc = Range.location;
Return (Loc < 6);
}
2015/10/2 iOS Notes details