标签: textlabel

是否可以调整UIButton的位置x,y titleLabel?

这是我的代码

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];

    [btn setFrame:CGRectMake(0.0f, 0.0f, 100.0f, 100.0f)];
    [btn setTitle:[NSString stringWithFormat:@"Button %d", i+1] forState:UIControlStateNormal];     
    [btn addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
    btn.titleLabel.frame = ???
Run Code Online (Sandbox Code Playgroud)

iphone uibutton textlabel ios

115
推荐指数
3
解决办法
5万
查看次数

uitableviewcell textlabel太长,推出detailtextlabel看不见

当我使用UITableViewCellStyleValue1时,我得到了一个长字符串的textLabel,并且不知何故,detailTextLabel从视图中被推出.

当我缩短textLabel文本时,我可以看到detailTextLabel的文本.

反正是否有限制textLabel的宽度在上面的样式,以便它将截断textLabel与它太长?

我的代码是:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];

}

cell.textLabel.lineBreakMode = UILineBreakModeTailTruncation;

//---get the letter in each section; e.g., A, B, C, etc.---
NSString *alphabet = [self.currencyNameIndex objectAtIndex:[indexPath section]];

//---get all states beginning with the letter---
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] %@", alphabet];
self.currencyList = [self.keyCurrencyName filteredArrayUsingPredicate:predicate];

if ([self.currencyList count] > 0) 
{
    NSString …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview textlabel

28
推荐指数
3
解决办法
2万
查看次数

如何制作一个秘密的iOS应用文本动画

我正在尝试复制Secret App的文本标签转换.有没有人最好的方法来接近它?

看起来他们每个字母都以明文开始,然后将其设置为灰色,然后是白色文本颜色.

以下是一些截图: 在此输入图像描述 在此输入图像描述在此输入图像描述在此输入图像描述

textlabel uiviewanimation ios app-secret

10
推荐指数
3
解决办法
3088
查看次数

当我在按钮中放置图像时,为什么我的UIButton.titleLabel.text会消失?

我以前遇到过这个问题,但是到目前为止我能够解决这个问题,基本上我正在创建一个自定义UI按钮,将其图像设置为uiimage,然后在我使用下面的代码之前有一个标签的按钮现在丢失了它的标签.我需要该标签,因为它是以编程方式在后面的代码中设置的.

 NSString *imageName = [NSString stringWithFormat:kNameOfButtonimage ];
            UIImage *image = [UIImage imageNamed:imageName];
            [button setImage:image forState:UIControlStateNormal ];
Run Code Online (Sandbox Code Playgroud)

任何你可以借出的帮助都会非常感激.

-缺口

iphone cocoa-touch uibutton uiview textlabel

3
推荐指数
1
解决办法
1748
查看次数

无法将textLabel添加到UICollectionViewCell吗?

我有一个类文件,它是该类的子UICollectionViewController类。在我的cellForItemAtIndexPath方法中,我试图设置textLabel的单元格。但是,textLabel完成中没有选项。到目前为止,这是方法:

override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as UICollectionViewCell
    // Configure the cell
    cell.backgroundColor = cellColor ? UIColor.blueColor() : UIColor.orangeColor()
    //cell.textLabel.text = "Text"???
    switch indexPath.item {
    case 0...5:
        cellColor = true
    case 6...13:
        cellColor = false
    default:
        cellColor = true
    }
}
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能将其添加textLabel到单元格中?

textlabel ios uicollectionview uicollectionviewcell swift

2
推荐指数
1
解决办法
5399
查看次数

textLabel在UITableViewCell中有两行+无(截止)

我有一个RSS提要阅读器应用程序,每个单元格从RSS提要苹果网站的XML中的元素中收集标题.现在标题很长,所以我想做的是使用以下方法增加每个单元格的大小:

 -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

return 80;
  }
Run Code Online (Sandbox Code Playgroud)

使标题分成两行或多行并展开,但文字继续直行并切断.我怎样才能解决这个问题?

xcode objective-c uitableview textlabel

1
推荐指数
1
解决办法
2636
查看次数