Iphone UIButton not working in nested UIViews

前端 未结 6 2087
醉梦人生
醉梦人生 2021-01-17 14:43

This is so damn simple im sure! Im missing something and im exhausted from trying to fix it. hopefully someone can help.

The Button in CharacterView.m works but the

6条回答
  •  遥遥无期
    2021-01-17 15:04

    FINALLY!!!!!!

    I had to init all the views with initWithFrame and pass in valid frame rects. Init should be used with controllers and initWithFrame passing rects for UIViews!!!!

    characterView = [ [ CharacterView alloc ] initWithFrame:CGRectMake(0, 0, 480, 320)]; 
    then 
    characterMale = [ [ CharacterMale alloc ] initWithFrame:frame];
    

提交回复
热议问题