Контроллер просмотра нагрузки из раскадровки с определенным размеромIOS

Программируем под IOS
Ответить
Anonymous
 Контроллер просмотра нагрузки из раскадровки с определенным размером

Сообщение Anonymous »

I want to know if it is possible to load/present modally a UIViewController with a "free form" size like the image below
Изображение

I want to load the red one always on top (always visible) and Взаимодействуйте с ViewController ниже (синий) одновременно. XIB показывается правильно, как я хочу, но связанный с ним uiviewController, ID не загружается, и я не знаю, почему ...


edit2: < /p>
С помощью файла xib я сделал следующее: < /p>
В Appdelegate у меня есть функция Showplayer, который называется с локальным уведомлением, чтобы показать xib < /p>

Код: Выделить всё

-(void)showPlayer:(int)tag andObjetoCancion:(NSArray *)objetoCancion
{

ZocaloPlayerViewController *vc = [[ZocaloPlayerViewController alloc] initWithNibName:@"ZocaloPlayerView" bundle:nil];
[vc setObjectoCancion:[objetoCancion mutableCopy]];

if (globals.isPlaying) {
[vc setCambiar:YES];
}else{
[vc setCambiar:NO];
}

//here playerView is a UIView initiated in didFinishLaunchingWithOptions
if (playerView == nil) {
playerView = [[UIView alloc] initWithFrame:CGRectMake(0,  self.window.frame.size.height, self.window.frame.size.width, altoPlayer)];
}

//keyWindow is UIWindow
//NSLog(@"Abro view %ld", (long)viewPlayer.tag);
keyWindow = [[[UIApplication sharedApplication] delegate] window];
[keyWindow addSubview:playerView];
[keyWindow bringSubviewToFront:playerView];

NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@"ZocaloPlayerView" owner:vc options:nil];
mainView = [subviewArray objectAtIndex:0];
mainView.translatesAutoresizingMaskIntoConstraints = NO;  //This part hung me up

[playerView addSubview:mainView];

//needed to make smaller for iPhone 4 dev here, so >=200 instead of 748
[playerView addConstraints:[NSLayoutConstraint
constraintsWithVisualFormat:@"V:|-0-[mainView]-0-|"
options:NSLayoutFormatDirectionLeadingToTrailing
metrics:nil
views:NSDictionaryOfVariableBindings(mainView)]];

[playerView addConstraints:[NSLayoutConstraint
constraintsWithVisualFormat:@"H:|-0-[mainView]-0-|"
options:NSLayoutFormatDirectionLeadingToTrailing
metrics:nil
views:NSDictionaryOfVariableBindings(mainView)]];

[UIView animateWithDuration:0.3 animations:^{
playerView.center = CGPointMake(self.window.frame.size.width / 2, self.window.frame.size.height - mitadAltoPlayer);
[self.window layoutIfNeeded];
}];

}
zocaloplayerviewcontroller *VC создается, но функция ViewDidload внутри его не называется .... это моя первая проблема ...
С Uiviewcontroller Free Formed, я не знаю, как это ...

Подробнее здесь: https://stackoverflow.com/questions/357 ... cular-size
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»