更新:
我再次遇到了这个问题,并找到了另一种方法.如果呈现控制器未嵌入导航控制器中,则如果呈现的控制器不是全屏并且将变为黑色,则将隐藏它.方法setModalPresentationStyle:UIModalPresentationCurrentContext只能应用于导航控制器.因此,在UINavigationController中嵌入呈现控制器,将UIModalPresentationCurrentContext设置为它并呈现新的控制器 - 您将获得对话框控制器.
我正在呈现搜索控制器,它有tableView推送堆栈详细控制器.
详细的控制器可以显示带有消息的视图控制器,它由小UIView和半透明背景组成.
问题:当最后一个视图控制器出现时,它下面的所有视图控制器都变得隐藏,而控制器,呈现搜索控制器变得可见
我在做什么:
SearchViewController *viewController = [[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:nil];
viewController.data = dataArray;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
[self.navigationController setModalPresentationStyle:UIModalPresentationCurrentContext];
[self.navigationController presentViewController:navigationController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
比表推动详细视图:
DetailViewController *viewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
[viewController setHidesBottomBarWhenPushed:YES];
viewController.dataItem = [data objectAtIndex:(NSUInteger) [indexPath row]];
[self.navigationController pushViewController:viewController animated:YES];
Run Code Online (Sandbox Code Playgroud)
和详细的视图呈现消息框:
MessageController *controller = [[MessageController alloc] initWithNibName:@"MessageController" bundle:nil];
controller.message = message;
[self presentViewController:controller animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
当它被解雇时,其下的所有控制器都变得可见.
更新:
我想要的是以模态方式呈现一个具有uitableview的视图控制器.从此表中显示将能够显示消息框的详细视图.消息框必须是另一个视图控制器.当显示消息框时,所有前两个控制器都会消失.这就是问题所在.
iphone objective-c uiviewcontroller presentmodalviewcontroller ios
我正在使用答案/sf/answers/407425651/和http://tips4java.wordpress.com/2008/11/10/table-column-adjuster/它可以工作,但是列的大小通常也是如此宽或太窄.
无论用HTML还是文本填充我的表格.
使用TableModeloracle文档中的标准.
调整模式= JTable.AUTO_RESIZE_OFF
我的容器是jGoodies:
FormLayout currentEventLayout = new FormLayout(
"fill:p",
"pref, pref");
PanelBuilder currentEventBuilder = new PanelBuilder(currentEventLayout);
currentEventBuilder.add(mainQuotesTable.getTableHeader(), constraints.xy(1, 1));
currentEventBuilder.add(mainQuotesTable, constraints.xy(1, 2));
Run Code Online (Sandbox Code Playgroud)
HTML示例:
"<html><pre><font size=+1 face='Arial'>" + firstValue + "\n" + secondValue + "</font></pre></html>"
Run Code Online (Sandbox Code Playgroud)
简单的行:
firstValue + " - " + secondValue
Run Code Online (Sandbox Code Playgroud)
这是一个例子:
public class TableAdjustExample {
private static JTable mainTable;
private static Random random = new Random();
private static List<Data> data;
private static class Data {
String name;
String surname; …Run Code Online (Sandbox Code Playgroud) 我的单元格中只有一个按钮,我添加了按钮高度 = 30、顶部 = 10 和底部 = 10 约束,因此 systemLayoutSizeFittingSize 必须返回单元格高度 = 50。尽管如此,它返回 50.5,我在日志中看到:
Will attempt to recover by breaking constraint
Run Code Online (Sandbox Code Playgroud)
我正在使用分组表视图并将分隔符设置为无。哪里需要额外0.5px?

代码片段:
[cell layoutSubviews];
return [cell systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;// 50;
Run Code Online (Sandbox Code Playgroud)
日志:
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix …Run Code Online (Sandbox Code Playgroud) ios ×2
objective-c ×2
autolayout ×1
iphone ×1
java ×1
jgoodies ×1
jtable ×1
swing ×1
tablecolumn ×1
uitableview ×1