Android - Comment puis-je spécifier poids par programme pour un RelativeLayout?

Je veux faire quelque chose comme ceci par programme -

<LinearLayout>
  <RelativeLayout1 weight = 1>
  <RelativeLayout2 weight = 3>
  <RelativeLayout3 weight = 1>
<LinearLayout>

Il ne me laisse pas faire setWeight par programmation. Cependant, je ne vois que RelativeLayout a un android:layout_weight paramètre en XML. Ai-je raté quelque chose?

OriginalL'auteur Suchi | 2011-05-20