0

データから UITableView を生成するアプリを作成しています。テキスト付きの UIButton を含むカスタム UITableViewCell があります。生成されたボタンの 1 つのタイトルが UIButton には長すぎますが、UIStoryBoard で選択したように切り捨てられません。- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPathセルは、プロトタイプ セルの通常どおり、UITableViewController 関数で作成されています 。

私は新しいユーザーなので画像を追加できませんが、画像へのリンクをいくつか示します。

UIStoryBoard 設定:切り捨て設定

タイトルが UIButton の境界からはみ出しています:オーバーフローしたテキスト

誰でもこれを修正する方法を知っていますか。以前は機能していました。UIButton のサイズとタイトルテキストのフォントを変更しましたが、違いはないと思います。

ボタンのテキストを内部に設定しているコードは次のとおりです- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

    CellIdentifier = @"PopoverCell";
    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    ((MSPopoverCell *)cell).nameLabel.text = data.FullName; //setting the label, works fine
    [((MSPopoverCell *)cell).button setTitle:data.DisplayString forState:UIControlStateNormal];//setting the button title, bleeds over

また、私はstackoverflowを初めて使用するので、含める必要があるものを見逃している場合は、親切なアドバイスをお願いします. ありがとう、マックス

4

0 に答える 0