Skip to content

tableview cell #142

@yestoall

Description

@yestoall

i'm having this runtime error:

layout.rb:273:in top_level_view': No default view has been defined for SearchCell. Implementtop_level_view`. (RuntimeError)

in my custom UITableViewCell class i have this

def initWithStyle style, reuseIdentifier: identifier
    super

    layout(self.contentView, :searchy) do
        @photo = subview(UIView,:cell_photo)
        @title = subview(UILabel,:cell_title)
        @year  = subview(UILabel,:cell_year)

        auto do 
            metrics "margin" => 20

            vertical "|-margin-[cell_photo(==110)]-(=>1)-|"
            vertical "|-margin-[cell_title(==20)]-margin-[cell_year(==20)]-margin-|"

            horizontal "|-margin-[cell_photo(==60)]-(=>1)-|"
            horizontal "|-margin-60-[cell_title]-margin-|"
            horizontal "|-margin-60-[cell_year]-margin-|"
        end
    end
    self.accessoryType  = UITableViewCellAccessoryNone
    self.selectionStyle = UITableViewCellSelectionStyleNone

    self
end

i don't know which parameter i need to send to my auto layout

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions