2010-06-17 2 views
1

나는 자바 코드 대신 XML 코드를 사용하여 genrate 수 있습니까?안드로이드 R.layout 개념

<TableRow 
android:id="@+id/LivingCreture" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"> 
<TextView android:text="LivingCreture" 
android:gravity="left" 
android:id="@+id/LivingCretureT" 
android:layout_width="45dp" 
android:layout_height="45dp"></TextView> 
<EditText android:text=" " 
android:gravity="center" 
android:id="@+id/LivingCretureE" 
android:layout_width="45dp" 
android:layout_height="45dp"></EditText> 
<ImageView android:id="@+id/ImageView03" android:layout_width="wrap_content"android:layout_height="wrap_content"></ImageView>  

가 possiable된다 내가 루프에서이 XML 코드를 수행 할 말할 수?

+0

에서보세요? 일정한 횟수 또는 런타임에서 결정되는 가변 횟수? 최종 INT NumOfRows = 10 – aioobe

+0

상수는 가정 할 수 있습니다 uniqe 이름 이리저리 내가 할 수있는 각 방법을 얻을 수 2.이 sthing 시간의 일정한 번호를 실행하는 complition에서 결정할 수 2.can? –

답변

0

최선의 선택은 "템플릿"태그 (루프에 추가하려는 모든 요소 포함)를 만들고 필요한 횟수만큼 <include> 태그를 사용하여 이러한 요소를 포함하는 것입니다.

당신을 "루프"할 않는 몇 번

+0

u를 감사하지만 1. 내가 어려운 내가 같은 다른 ID로 모든 시간을 작업 할 때 작업을 찾을 포함 의미는 내가 아래에이 코드의 두 싶은 말은 할 수 있습니다 : –