Click here to Close
打印

[讨论] 請教幾句command...

請教幾句command...

想用自己的圖片做一個按鈕,  打了以下的commnand
可是為什麼在電話上顯示不出來?
  UIImage* btnImage = [UIImage imageNamed:@"Playbutton.png"];
  UIImage* btnImagePressed = [UIImage imageNamed:@"Playbuttonpressed.png"];
  UIPushButton* pushButton = [[UIPushButton alloc] initWithImage:btnImage];
  [pushButton setFrame: CGRectMake(100.0, 130.0, 100.0, 50.0)];
  [pushButton setDrawsShadow: NO];
  [pushButton setEnabled:YES];
  [pushButton setStretchBackground:YES];
  [pushButton setImage:btnImage forState:0];  //up state
  [pushButton setImage:btnImagePressed forState:1]; //down state

還有[pushButton setFrame: CGRectMake(100.0, 130.0, 100.0, 50.0)];
那一數字才是X 和 y 值呀??

[ 本帖最后由 hemmy 于 2008-1-12 13:07 编辑 ]
100.0, 130.0, 100.0, 50.0分别是起始点横坐标,纵坐标,Rect的宽度,高度

TOP

謝謝樓上的..可是為什麼還是顯示不出來呀?
顶一个LZ!
同问!
深公网安备案证字第 4403101901155 号