안드로이드 개발 질문/답변
(글 수 45,052)
TextView에 xml로 android:layout_margin 을 자바에서 직접 설정하려면요?
<TextView
android:id="@+id/detail_infomation"
android:layout_margin ="5px"
/>
bold로 된 마진부분을
자바에서
TextView txtValue = new TextView(this);
로 설정할려고하는데 이건 어떻게 설정해야될지...
<TextView
android:id="@+id/detail_infomation"
android:layout_margin ="5px"
/>
bold로 된 마진부분을
자바에서
TextView txtValue = new TextView(this);
로 설정할려고하는데 이건 어떻게 설정해야될지...




<LinearLayout>
<TextView />
</LinearLayout>
코드로는....
TextView textView = new TextView( this );
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( w, h ) ;
params.setMargins( left, top, right, bottom );
textView.setLayoutParams( params );
일케 하면 됩니다 -ㅅ-;