0

i am designing an app that show english and arabic. Each row, it is showing different langauage.

so when i scroll, the text alignment is changing. sometime english text is aligned right and arabic text aligned left.

i need to show engligh text alignment is left and arabic text alignment is right.

it works only after i go to next view and comeback.

2 Answers2

0

The problem is happening because of 'dequeueReusableCellWithIdentifier' Try setting text alignment based on language each time cell is reused.

nikBhosale
  • 531
  • 1
  • 5
  • 27
0

Try this when pop back to controller :

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [tblView beginUpdates];
    [tblView reloadRowsAtIndexPaths:[tblView indexPathsForVisibleRows]
                       withRowAnimation:UITableViewRowAnimationNone];
    [tblView endUpdates];

}
KKRocks
  • 8,222
  • 1
  • 18
  • 84
  • textalignment is not working correctly when initalizing tableview itself. only showing correct text alignment, after i load tableview and go to detailview then comeback – Giridharan Kannan Nov 04 '16 at 07:47