Skizit
Skizit

Reputation: 44862

Android: Make view equal to parent width -20 dip?

Is there a way to set a layouts width to be the width of it's parent -20 dip? I'm dealing with a Tablerow

Upvotes: 0

Views: 411

Answers (2)

Graham Borland
Graham Borland

Reputation: 60721

Set its left and right padding as needed.

<TableRow
   android:paddingLeft="10dp"
   android:paddingRight="10dp"
   ...
/>

Upvotes: 2

Krishna
Krishna

Reputation: 1474

Try giving TableRow

android:paddingRight="10dip" android:paddingLeft="10dip" 

which makes it look like its width is 20dpi less than that of parent.

Upvotes: 2

Related Questions