Detected a case where constraints ambiguously suggest a height of zero
Three things have managed to silence this warning so far. You can pick up the most convenient for you. Nothing pretty though.
To set up default cell's height in viewDidLoad
self.tableView.rowHeight = 44;
Go to storyboard and change row height on your tableview to something different than 44.
To implement tableview's delegate method heightForRowAtIndexPath
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 44;
}
Weird.
SwiftUI: Detected a case where constraints ambiguously suggest a height of zero for a table view cell's content view
A workaround solution would be to use a List
View instead of a Form
.
It all depends on what you want to put in your Form
.
For demonstration purpose, using a List
, your code would look like this:
struct ContentView: View {
@State private var selectedDate: Date = Date()
var body: some View {
List {
DatePicker("Date", selection: $selectedDate, displayedComponents: .date)
}
.listStyle(InsetGroupedListStyle())
}
}
The above gives the same visual effect (UI) as using a List
, and no warning is shown.
Because everything is working correctly with your Form
, I don't really see the need to change your Form
to a List
just to avoid the logs.
ios 8 (UITableViewCell) : Constraints ambiguously suggest a height of zero for a tableview cell's content view
Auto Layout is right on that one. It's impossible to calculate cell's height from .CenterX
and .Top
for the label. One way to resolve the problem would be removing the existing .CenterX
constraint and adding a new .Bottom
constraint. That way, Auto Layout could easily calculate cell's height.
iOS8 - constraints ambiguously suggest a height of zero
Forcing a return height and estimated height made the warning disappear in my case.
- (CGFloat)tableView:(UITableView *)tableView
estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
Another solution where you don't need the two overrides is simply to use self.tableView.rowHeight = 44;
in your loadView
or init method.
warning while setting table row height for a tableView cell -iOS 9
If you want to use UITableViewAutomaticDimension
then you must use autolayout and give proper constraints.
Because UITableViewAutomaticDimension
depends on autolayout. so make sure you gave proper constraint to your tableview's cell content.
first element of cell should have top constrains and last should have bottom and every element should have connection vertically via top or bottom constraint.
Refer Apple documentation for more detail.
Hope this will help :)
Permanently Delete MailMessage in Outlook with VBA?
Try moving it first then deleting it (works on some patchs in 2000) or use RDO or CDO to do the job for you (you will have to install them)
Set objDeletedItem = objDeletedItem.Move(DeletedFolder)
objDeletedItem.Delete
CDO way
Set objCDOSession = CreateObject("MAPI.Session")
objCDOSession.Logon "", "", False, False
Set objMail = objCDOSession.GetMessage(objItem.EntryID, objItem.Parent.StoreID)
objMail.Delete
RDO
set objRDOSession = CreateObject("Redemption.RDOSession")
objRDOSession.MAPIOBJECT = objItem.Session.MAPIOBJECT
set objMail = objRDOSession.GetMessageFromID(objItem.EntryID>)
objMail.Delete
You could also mark the message first before you delete it and the loop through the deleted items folder and find it an dthe call delete a second time. Mark it using a Userproperty.
objMail.UserProperties.Add "Deleted", olText
objMail.Save
objMail.Delete
loop through you deleted items look for that userprop
Set objDeletedFolder = myNameSpace.GetDefaultFolder(olFolderDeletedItems)
For Each objItem In objDeletedFolder.Items
Set objProperty = objItem.UserProperties.Find("Deleted")
If TypeName(objProperty) <> "Nothing" Then
objItem.Delete
End If
Next
Table view inside a cell of table view, however its frame height is 0
After dozen of tries I decided to use this constraint for table view, that is located inside a cell of static table view:
tableView.heightAnchor.constraint(equalToConstant: CGFloat(splits.count) * 27)
But there's still a problem - magic value. 27 is a sum of 17, which is a height of label and 10 is a sum of constant of bottom and top constraints of label in an inner table view's cell.
I'm convinced there's a better solution somewhere, but for now it's better than nothing.
UITableView Custom Cell Height Not Working
You haven't implemented the UITableViewDelegate
In your setupTable()
add the line
tableView.delegate = self
Then change your extension from
extension ViewController: UITableViewDataSource {
to extension ViewController: UITableViewDataSource, UITableViewDelegate {
Related Topics
How to Parse This JSON in Swift
Differencebetween Embedded Binaries and Linked Frameworks
Afnetworking: Handle Error Globally and Repeat Request
Presentviewcontroller and Displaying Navigation Bar
How to Write Init Methods of a Uiviewcontroller in Swift
Ios: Change the Height of Uisegmentedcontrol
Custom Pin Image in Annotationview in iOS
How to Change the Highlighted Color of a Uibutton
Memory-Mapped Files and Low-Memory Scenarios
Waiting for Asynchronous Function Call to Complete
Uicollectionview Horizontal Paging - How to Use Flow Layout
How to Get Distance of Object from iPhone Camera Using Image Exif Meta Data
Refresh Certain Row of Uitableview Based on Int in Swift
How to Change Navigation Bar Color in iOS 7 or 6