Comment placer textview à l'aide de x,position y
Je suis nouveau sur android,quelqu'un Peut m'aider?.J'ai besoin de montrer le textview valeurs et bouton et imageview à l'aide de x,y de la position.comment son possible.Mon codage.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/levelbg" >
<Button
android:id="@+id/level1"
android:layout_width="560dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="71dp"
android:background="@drawable/levelbox"
/>
<TextView
android:id="@+id/levelno1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="43dp"
android:background="@drawable/levelno" />
<TextView
android:id="@+id/lastshoot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/level1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="18dp"
android:layout_marginLeft="85dp"
android:text="134"
android:textSize="20sp" />
<TextView
android:id="@+id/bestshoot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/lastshoot1"
android:layout_alignBottom="@+id/lastshoot1"
android:layout_marginLeft="50dp"
android:layout_toRightOf="@+id/lastshoot1"
android:text="123"
android:textSize="20sp" />
<ImageView
android:id="@+id/levelonestar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/bestshoot1"
android:layout_marginLeft="17dp"
android:layout_marginBottom="10dp"
android:layout_toRightOf="@+id/bestshoot1"
android:src="@drawable/star1" />
<ImageView
android:id="@+id/levelonestar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/levelonestar1"
android:layout_toRightOf="@+id/levelonestar1"
android:src="@drawable/star1" />
<ImageView
android:id="@+id/levelonestar3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/levelonestar2"
android:layout_toRightOf="@+id/levelonestar2"
android:layout_marginRight="2dp"
android:src="@drawable/star1" />
J'ai besoin de cette via par programmation jusqu'à 50 fois il doit être montré.(50 boutons).Quelqu'un peut-il me suggérer une autre façon,Merci d'avance.
OriginalL'auteur user123 | 2013-01-07
Vous devez vous connecter pour publier un commentaire.
Android >= Nid d'abeille (auto-explicatif)
Android < Nid d'abeille
Au lieu de directement mettre en position de vous dire "jeu de x pixels à partir de la gauche/haut/droite/bas de la frontière".
Alors montrez-nous votre sortie. Plus d'info, plus de service.
OriginalL'auteur Simon Schubert