Skip to content

UI layout throws exception on Android but not iOS #68

Description

@amirrajan
border = UI::View.new

{
  background_color: :black,
  width: 50,
  height: 50,
  align_self: :center
}.each do |k, v|
    border.send("#{k}=", v)
  end
end

view.add_child border
view.update_layout

This however works:

border = UI::View.new

{
  background_color: :black,
  width: 50,
  height: 50,
  align_self: :center
}.each do |k, v|
    if v == :center
      border.send("#{k}=", :center)
    else
      border.send("#{k}=", v)
    end
  end
end

view.add_child border
view.update_layout

The following properties would be impacted because of this (I think):

  • direction, "inherit", "ltr", "rtl"
  • flex_direction, "column", "column_reverse", "row", "row_reverse"
  • justify_content, "flex_start", "center", "flex_end", "space_between", "space_around"
  • align_content, "auto", "flex_start", "center", "flex_end", "stretch"
  • align_items, "auto", "flex_start", "center", "flex_end", "stretch"
  • align_self, "auto", "flex_start", "center", "flex_end", "stretch"
  • position_type, "relative", "absolute"
  • flex_wrap, "no_wrap", "wrap"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions