mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 22:51:53 +08:00
Merge pull request #212 from GantMan/text_align_alias
alias for text_align instead of text_alignment (for us web folk)
This commit is contained in:
@@ -41,6 +41,8 @@ module RubyMotionQuery
|
||||
def text_alignment
|
||||
@view.textAlignment
|
||||
end
|
||||
alias :text_align= :text_alignment=
|
||||
alias :text_align :text_alignment
|
||||
|
||||
def resize_to_fit_text
|
||||
@view.sizeToFit
|
||||
|
||||
@@ -21,6 +21,11 @@ class StyleSheetForUIViewStylerTests < RubyMotionQuery::Stylesheet
|
||||
st.text_alignment = :centered
|
||||
end
|
||||
|
||||
def ui_label_text_align(st)
|
||||
ui_label_kitchen_sink(st)
|
||||
st.text_align = :right
|
||||
end
|
||||
|
||||
def ui_label_attributed_string(st)
|
||||
st.attributed_text = NSAttributedString.alloc.initWithString("RMQ")
|
||||
end
|
||||
@@ -64,6 +69,14 @@ describe 'stylers/ui_label' do
|
||||
end
|
||||
end
|
||||
|
||||
it 'should use text_align as an alias for ui_label_text_align' do
|
||||
view = @vc.rmq.append(@view_klass, :ui_label_text_align).get
|
||||
|
||||
view.tap do |v|
|
||||
v.textAlignment.should == NSTextAlignmentRight
|
||||
end
|
||||
end
|
||||
|
||||
it "applies an attributed string" do
|
||||
view = @vc.rmq.append(@view_klass, :ui_label_attributed_string).get
|
||||
|
||||
|
||||
Reference in New Issue
Block a user