Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table view auto size row height functionality #574

Merged
merged 2 commits into from Dec 5, 2014

Conversation

carlinisaacson
Copy link
Contributor

Per issue #553

row_height(height, args={})

Class method that sets the screen's table row height.

class MyTableScreen < PM::TableScreen
  title "Table screen"
  row_height :auto, estimated: 44
end

@silasjmatson
Copy link

👍

@@ -255,6 +263,16 @@ def table_style
UITableViewStylePlain
end

def row_height(height, args={})
height = UITableViewAutomaticDimension if height == :auto

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd clean this up a bit.

if height == :auto
  height = UITableViewAutomaticDimension
else
  args[:estimated] ||= height
end
@row_height = { height: height, estimated: args[:estimated]  || 44 }

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is really cleaner.

@ryanlntn
Copy link
Contributor

👍

jamonholmgren added a commit that referenced this pull request Dec 5, 2014
…-cell

Table view auto size row height functionality
@jamonholmgren jamonholmgren merged commit 99bf2f8 into master Dec 5, 2014
@jamonholmgren
Copy link
Owner

Thanks @carlinisaacson !

@jamonholmgren jamonholmgren deleted the feature/auto-size-table-cell branch December 5, 2014 18:54
@jamonholmgren
Copy link
Owner

@carlinisaacson Can you update the wiki please?

@jamonholmgren
Copy link
Owner

@carlinisaacson ^^ bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants