2013-10-14 28 views
0

我也有類似的網絡調查問卷形式的場景,說我有表上3個問題:iOS的UI/UX建議需要有關動態隱藏和顯示領域

一個 乙 Ç

只有B當我回答是肯定的質疑出現,C時,我回答是質疑B.

是否有關於如何實現這種UI的iOS上的任何指引纔出現?或者我們只是簡單地按照Web的方式來做iOS?因爲我在iOS應用程序中沒有看到這些示例。

感謝和問候

+6

這可能是在http://ux.stackexchange.com/更合適 – BergQuester

回答

1

一個相對簡單的方式做,這是在一個UITableView並通過的UITableViewController。當用戶回答每個問題時,可以通過添加一行來顯示下一個問題。添加一行的代碼如下,應該放在一個tableViewController中。

-(void)showNextRow:(int)row inSection:(int)section 
{ 
    NSArray *newRowIndexPath = @[[NSIndexPath indexPathForRow:row inSection:section]]; 

    UITableView *tv = (UITableView *)self.view; 
    [tv beginUpdates]; 
    [tv insertRowsAtIndexPaths: newRowIndexPath withRowAnimation:UITableViewRowAnimationFade]; 
    [tv endUpdates]; 
} 

您將需要跟蹤的所有問題,並正在回答當前問題,將不得不使用保留以下功能最新

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 

並填充數據模型您UITableViewCells