【问题标题】:Is it possible to design like three layouts in iOS devices (both iPhone and iPad also)like in the attached picture (for reference see the pic.)?是否可以像附图中那样在 iOS 设备(iPhone 和 iPad 也一样)中设计三种布局(供参考,请参见图片。)?
【发布时间】:2017-06-24 14:20:29
【问题描述】:

三列(即每列中的三个表视图)UI 设计视图。

  1. 在 iPhone 和 iPad 上设计 UI 就像 3 列不同的 tableviews

  2. 在所有列之间也需要交互,例如在第一个表格视图中选择一个单元格时,相应的单元格详细信息需要显示在中间表格视图中。(如拆分视图控制器。)

  3. 最后,在第三个表格视图控制器中也需要显示一些零售商名称。

【问题讨论】:

  • 是的,可能,但您的图片显示的是空的故事板场景。
  • 实际上,屏幕截图本身就像一个视图控制器内的三个表视图,就像左面板一个表视图,中间编辑器像一个表视图,右面板像另一个表视图,但最后我需要放所有 3 合 1 控制器。

标签: ios iphone uitableview user-interface ipad


【解决方案1】:

是的,可以按照下面的iProSoccer 应用截图所示进行创建。选择左侧表格中的计划会显示中间列中的练习。右栏包含可拖入计划的可用练习(中间栏)。这是一个单视图控制器,包含三个添加为子视图控制器的表控制器。

编辑

每个UITableViewController 定义一个protocol 并委托包含UIViewController 订阅。当用户的操作,例如,在左表视图中点击一个计划时,左表视图控制器告诉(发送消息给)委托(包含UIViewController)。在此示例中,消息包括已选择的计划。包含UIViewController 更新中心UITableViewController 与计划。然后中心UITableViewController 加载计划的详细信息。

(子)PlanTableViewController.h 的片段,包括协议和委托定义:

#import "Plan.h"

@class PlanTableViewController;

@protocol PlanTableViewControllerDelegate <NSObject>

-(void)planSelected:(Plan *)plan sender:(id)sender;

    // Additional protocol methods here...

@end

@interface PlanTableViewController : UITableViewController 

@property (nonatomic, weak)id <PlanTableViewControllerDelegate>delegate;

    // Additional properties and methods here...

@end

(父)PlanningTableViewController.m 的片段,包括委托方法的实现:

@interface PlanningTableViewController () {

    PlanTableViewController *planTableViewController;

    // Additional properties declarations here...

@end

@implementation PlanningTableViewController 


- (void)viewDidLoad {
    [super viewDidLoad];

    planTableViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"planTableViewController"];
    planTableViewController.delegate = self;
}

#pragma mark - PlanTableViewController delegate methods

- (void)planSelected:(Plan *)plan sender:(id)sender {

    [drillTableViewController planSelected:plan];
}

// Additional delegate methods here...

@end

【讨论】:

  • 谢谢,但是如何在 iOS 和 Objective C 中实现所有表视图之间的同步
猜你喜欢
  • 2017-01-15
  • 2021-02-01
  • 1970-01-01
  • 2020-03-16
  • 1970-01-01
  • 1970-01-01
  • 2017-04-09
  • 2018-07-09
  • 2019-10-28
相关资源
最近更新 更多