Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

WARN: [TIUIView autoWidthForWidth] should have been overridden

I'm trying to get a TableView to display long text and having trouble doing so. While fiddling with the parameters of the table view, I got the following error:

>[WARN] > contained >, but called AutoWidthForView was called for it anyways.This typically means that -[TIUIView autoWidthForWidth] should have been overridden.

The greater-than symbols around the "contained" are literal. This is an accurate cut-paste.

The code that caused this appears to have been

var tableView = Ti.UI.createTableView({
  data: [],
  separatorStyle: Titanium.UI.iPhone.TableViewSeparatorStyle.NONE,
  height: 'auto',
  width: 'auto',
  layout: 'vertical'

Any thoughts?

— asked March 16th 2010 by Allen Firstenberg
  • createtableview
  • error
  • iphone
  • mobile
  • tableview
  • warn

1 Answer

  • Accepted Answer


    Try removing the 'auto' width and height in the createTableView call, then use height:'auto' in your createTableViewRow call.

    Then use height:'auto', layout:'vertical' in the properties of the labels etc that you add to each row.

    See the demo in Kitchen Sink : Base UI > Views > Table Views > Auto-height

    JS: Resources/examples/table_view_api_auto_height.js

    hope this helps.

    — answered March 16th 2010 by Kosso
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.