Tag: 公正

findUILabel的底部位置,以便可以在下面创build第二个UILabel

我有一个新的文章,我正在创build。 正在为文章标题添加UILabel 。 标题文本有时可能是一行,两行或三行文本。 然后我需要在标题下面创build一个UILabel 。 由于标题具有dynamic高度,因此我无法定位dateUILabel 。 有一个计算来获得我的UILabel的框架的底部位置? 注:我正在使用siteToFit来确保UILabel的框架适合。 // Text UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, self.view.bounds.size.width-20, 50)]; //title.backgroundColor = [UIColor clearColor]; title.backgroundColor = [UIColor redColor]; title.text = self.firstItem.title; //title.text = @"This is a test of a short title that is a little longer"; title.textColor = [UIColor whiteColor]; title.layer.shadowColor = [UIColor blackColor].CGColor; […]