Re: [android-developers] RelativeLayout issue

2014-05-11 Thread dashman
android:layout_alignParentLeft=true
android:layout_alignParentRight=true


No changes - still the full width of the parent View (not layout)



On Saturday, May 10, 2014 9:06:10 PM UTC-4, TreKing wrote:


 On Sat, May 10, 2014 at 6:57 PM, dashman erjd...@gmail.com 
 javascript:wrote:

 Shouldn't the width of the button be 60dp - 
 since i've set the width of the button to match-parent - and it's set to 
 60dp in the layout.

 It's actually taking up the full width of the parent view - not layout.


 You'd think, right?

 To achieve what you're looking for, try setting both align_parentLeft and 
 align_parentRight


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago 
 transit tracking app for Android-powered devices
  

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] RelativeLayout issue

2014-05-11 Thread Piren
I've come across something like that before. RelativeLayouts do not like 
their children doing something like that (or asking to be aligned to the 
right/bottom). 

Just use a size variable for both the parent and child (see 
dimensions.xml), will save you the headache understanding android's layout 
mechanism. 

On Sunday, May 11, 2014 3:37:09 PM UTC+3, dashman wrote:

 android:layout_alignParentLeft=true
 android:layout_alignParentRight=true


 No changes - still the full width of the parent View (not layout)



 On Saturday, May 10, 2014 9:06:10 PM UTC-4, TreKing wrote:


 On Sat, May 10, 2014 at 6:57 PM, dashman erjd...@gmail.com wrote:

 Shouldn't the width of the button be 60dp - 
 since i've set the width of the button to match-parent - and it's set to 
 60dp in the layout.

 It's actually taking up the full width of the parent view - not layout.


 You'd think, right?

 To achieve what you're looking for, try setting both align_parentLeft and 
 align_parentRight


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago 
 transit tracking app for Android-powered devices
  


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] RelativeLayout issue

2014-05-11 Thread Kostya Vasilyev
Yep: a child with alignParentRight / alignParentBottom will cause the
parent (the RelativeLayout) to stretch to the entire width / height of
*its* parent.

-- K


2014-05-11 17:05 GMT+04:00 Piren gpi...@gmail.com:

 I've come across something like that before. RelativeLayouts do not like
 their children doing something like that (or asking to be aligned to the
 right/bottom).

 Just use a size variable for both the parent and child (see
 dimensions.xml), will save you the headache understanding android's layout
 mechanism.


 On Sunday, May 11, 2014 3:37:09 PM UTC+3, dashman wrote:

 android:layout_alignParentLeft=true
 android:layout_alignParentRight=true


 No changes - still the full width of the parent View (not layout)



 On Saturday, May 10, 2014 9:06:10 PM UTC-4, TreKing wrote:


 On Sat, May 10, 2014 at 6:57 PM, dashman erjd...@gmail.com wrote:

 Shouldn't the width of the button be 60dp -
 since i've set the width of the button to match-parent - and it's set
 to 60dp in the layout.

 It's actually taking up the full width of the parent view - not layout.


 You'd think, right?

 To achieve what you're looking for, try setting both align_parentLeft
 and align_parentRight

 
 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] RelativeLayout issue

2014-05-11 Thread dashman
But isn't the logical parent of the child - it's layout parent.

in that i've set the width explicitly.



On Sunday, May 11, 2014 9:12:00 AM UTC-4, Kostya Vasilyev wrote:

 Yep: a child with alignParentRight / alignParentBottom will cause the 
 parent (the RelativeLayout) to stretch to the entire width / height of 
 *its* parent.

 -- K


 2014-05-11 17:05 GMT+04:00 Piren gpi...@gmail.com javascript::

 I've come across something like that before. RelativeLayouts do not like 
 their children doing something like that (or asking to be aligned to the 
 right/bottom). 

 Just use a size variable for both the parent and child (see 
 dimensions.xml), will save you the headache understanding android's layout 
 mechanism. 


 On Sunday, May 11, 2014 3:37:09 PM UTC+3, dashman wrote:

 android:layout_alignParentLeft=true
 android:layout_alignParentRight=true


 No changes - still the full width of the parent View (not layout)



 On Saturday, May 10, 2014 9:06:10 PM UTC-4, TreKing wrote:


 On Sat, May 10, 2014 at 6:57 PM, dashman erjd...@gmail.com wrote:

 Shouldn't the width of the button be 60dp - 
 since i've set the width of the button to match-parent - and it's set 
 to 60dp in the layout.

 It's actually taking up the full width of the parent view - not layout.


 You'd think, right?

 To achieve what you're looking for, try setting both align_parentLeft 
 and align_parentRight

 
 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago 
 transit tracking app for Android-powered devices
  
  -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to android-developers+unsubscr...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] RelativeLayout issue

2014-05-10 Thread dashman
I've got a layout (that's a listitem) and want to set a fixed width.
(it's a horizontal listview)

?xml version=1.0 encoding=utf-8?
RelativeLayout
  xmlns:android=http://schemas.android.com/apk/res/android;
  android:layout_width=60dp
  android:layout_height=wrap_content
  
  
Button
android:id=@+id/action_toggle
android:layout_width=match_parent
android:layout_height=10dp
android:layout_alignParentTop=true
android:background=@drawable/green_button2
/
/RelativeLayout

(i've removed items above to the bare minimum)

Shouldn't the width of the button be 60dp - 
since i've set the width of the button to match-parent - and it's set to 
60dp in the layout.

It's actually taking up the full width of the parent view - not layout.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] RelativeLayout issue

2014-05-10 Thread TreKing
On Sat, May 10, 2014 at 6:57 PM, dashman erjdri...@gmail.com wrote:

 Shouldn't the width of the button be 60dp -
 since i've set the width of the button to match-parent - and it's set to
 60dp in the layout.

 It's actually taking up the full width of the parent view - not layout.


You'd think, right?

To achieve what you're looking for, try setting both align_parentLeft and
align_parentRight

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.