UIProgressView默认为主视图的左上角

时间:2010-10-04 12:02:00

标签: iphone uiprogressview

我的UIProgressView将转到主视图的右上角 - 即使我将其设置为UIView的子视图(后者又是主视图的子视图)。即使我setFrame:

有什么想法吗?

if(downloadBar == nil){
  downloadBar = [[UIProgressView alloc] initWithFrame:CGRectMake(10, 10, 200, 10)];
}
[downloadBar setProgressViewStyle:UIProgressViewStyleDefault];
[downloadBar setProgress:([download downloadStatus]/100.0f)];
[downloadView addSubview:downloadBar];



// download view initialisation
// this is initalised BEFORE the download bar
    downloadView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 300, 300)];
        [downloadView setBackgroundColor:[UIColor lightGrayColor]];
        [self.view addSubview:downloadView];
        [downloadView retain];

由于

1 个答案:

答案 0 :(得分:0)

我认为这取决于你的downloadView。因为downloadBar的原点坐标(0,0)将位于downloadView的原点坐标(0,0)的相同位置。因此,如果您下载View位于右上角,则downloadBar将是相同的