Ios UITableViewRowAction更改字体和/或大小

Ios UITableViewRowAction更改字体和/或大小,ios,uitableview,ios8,uitableviewrowaction,Ios,Uitableview,Ios8,Uitableviewrowaction,我有一个UITableView,其中单元格有一些UITableViewRowActions。我们的模型使用更小的字体和更窄的UITableViewRowAction按钮。是否可以以任何方式更改UITableViewRowAction的字体和/或大小 声明这是不可能的,因此我询问是否还有其他方法。UITableViewCell由背景视图和内容视图组成,它覆盖backgroundView您可以做的是将ui按钮作为子视图添加到backgroundView中,并在单元格上添加uipangestrerec

我有一个UITableView,其中单元格有一些UITableViewRowActions。我们的模型使用更小的字体和更窄的UITableViewRowAction按钮。是否可以以任何方式更改UITableViewRowAction的字体和/或大小


声明这是不可能的,因此我询问是否还有其他方法。

UITableViewCell
背景视图和
内容视图组成,它覆盖
backgroundView
您可以做的是将
ui按钮作为
子视图添加到
backgroundView
中,并在单元格上添加
uipangestrerecognizer
。因此,当您仅水平平移单元格时,
contentView
移动,
UIButton
s就会暴露出来。因此在
cellforrowatinexpath

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
   UITableViewCell *myCell;
        myCell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"YOUR_IDENTIFIER"];

   //adding button to a view that is added as the backgroundview
   UIView *cellBackgroundUtilityView=[[UIView   alloc]initWithFrame:myCell.frame];
   [cellBackgroundUtilityView addSubview:<your button>]
   [myCell setBackgroundView: cellBackgroundUtilityView]

   //adding a gesture recognizer
   UIPanGestureRecognizer *panningCell=[[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(yourPanningTableViewCellMethod:)];
   [panningCell setDelegate:self];
   [myCell addGestureRecognizer:panningCell];
}
当按钮的选择器被调用时

-(void)yourBackgroundViewButtonWasPressed
{
 // button was pressed
 // move content view of the cell back to origin
 [tableCell.contentView setFrame:CGRectMake(0.0, tableCell.contentView.frame.origin.y, tableCell.frame.size.width, tableCell.frame.size.height)];

 //do your stuff
}

UITableViewCell
backgroundView
contentView
组成,后者覆盖
backgroundView
您可以做的是将
UIButton
s作为
子视图添加到
backgroundView
中,并在单元格上添加
UIPangestureRecognitor
。因此,当您仅水平平移单元格时,
contentView
移动,
UIButton
s就会暴露出来。因此在
cellforrowatinexpath

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
   UITableViewCell *myCell;
        myCell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"YOUR_IDENTIFIER"];

   //adding button to a view that is added as the backgroundview
   UIView *cellBackgroundUtilityView=[[UIView   alloc]initWithFrame:myCell.frame];
   [cellBackgroundUtilityView addSubview:<your button>]
   [myCell setBackgroundView: cellBackgroundUtilityView]

   //adding a gesture recognizer
   UIPanGestureRecognizer *panningCell=[[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(yourPanningTableViewCellMethod:)];
   [panningCell setDelegate:self];
   [myCell addGestureRecognizer:panningCell];
}
当按钮的选择器被调用时

-(void)yourBackgroundViewButtonWasPressed
{
 // button was pressed
 // move content view of the cell back to origin
 [tableCell.contentView setFrame:CGRectMake(0.0, tableCell.contentView.frame.origin.y, tableCell.frame.size.width, tableCell.frame.size.height)];

 //do your stuff
}