많은 셀 안에 큰 텍스트를 표시해야하는 일정을 개발 중입니다. 단추에 하루의 숫자를 나타내는 텍스트가 있습니다. 어떻게 다른 textView를 첨부 할 수 있습니까? 그 안에?단추 안에 여러 TextViews를 추가하는 방법
0
A
답변
0
버튼에 TextView를 추가 할 수 없습니다. 할 수있는 일은 레이아웃 (Relative/Linear/Frame/etc)을 사용하여 Textviews를 캡슐화하는 것입니다. 그런 다음 레이아웃에 onClickListener를 설정합니다!
당신의 XML은 다음과 같이 보일 것입니다 :
<RelativeLayout>
<TextView/>
<TextView/>
...
</RelativeLayout>
은 물론, 당신은 그것을에 속성을 추가해야합니다. 또한 onClickListener를 RelativeLayout (또는 원하는 레이아웃)으로 설정하십시오!
+0
답변 해 주셔서 감사합니다. :)하지만 버튼의 텍스트가 필요합니다 :(하지만 내가 언급 한 버튼은 이미 텍스트 (하루의 숫자) –
0
버튼을 FrameLayout으로 묶은 다음 FrameLayout 내에 텍스트 뷰를 추가 할 수 있습니다. 텍스트가 bringToFront를 사용하여 시도되지 않는 경우()
레이아웃 :
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:id="@+id/button_frame"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_border"
android:gravity="center"
android:onClick="onClick"
android:text="@string/get_more"
android:id="@+id/get_more"
android:stateListAnimator="@null"
/>
<TextView
android:id="@+id/linearTimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="right"
android:padding="10dp"
android:text="123"
>
</FrameLayout>
활동 :
countDownView = (TextView) findViewById(R.id.linearTimer);
countDownView.bringToFront();
관련 문제
- 1. RelativeLayout에 프로그래밍 방식으로 여러 TextViews를 추가하는 방법
- 2. linearview 안에 textViews를 가운데에 배치하는 방법은 무엇입니까?
- 3. CCArray 안에 여러 개의 CCSprites를 추가하는 방법
- 4. Silverlight의 프레임 안에 여러 컨트롤을 추가하는 방법
- 5. 가로형 LinearLayout에 여러 TextViews를 올리면
- 6. 안드로이드에서 textviews를 분리하는 방법?
- 7. sharepoint 단추 클릭 코드 처리기를 추가하는 방법
- 8. 행에 textviews를 동등하게 추가하는 방법은 무엇입니까?
- 9. 어댑터를 수정하여 listview에서 여러 textviews를 설정하십시오.
- 10. 부트 스트랩 단추, 여러 번 클릭하는 방법
- 11. MainActivity에 두 번째 단추 코드를 추가하는 방법
- 12. 다트 - 종이 단추 - onclick 스크립트를 추가하는 방법
- 13. C# 단추 배열 단추에 이미지를 추가하는 방법
- 14. C# 단추 문제에 포커스를 추가하는 방법
- 15. 여러 단추 양식 작업
- 16. IText : pdf 안에 빈 페이지를 추가하는 방법?
- 17. iframe의 본체 안에 javascript 함수를 추가하는 방법
- 18. XAML의 도형 안에 텍스트를 추가하는 방법
- 19. Asp.net : 스크립트 태그 안에 using을 추가하는 방법
- 20. 안드로이드 : scrollview 안에 listview를 추가하는 방법.?
- 21. WPF에서 datepicker 안에 체크 박스를 추가하는 방법
- 22. 조각 안에 동적으로 뷰를 추가하는 방법
- 23. CSS가 작동하는 div 안에 테이블을 추가하는 방법
- 24. 동적으로 이미지 단추를 만들 때 이미지 단추 안에 텍스트를 추가하는 방법
- 25. RunOnUiThread를 사용하여 화면의 일부 TextViews를 업데이트하는 방법
- 26. 데이터 표보기에서 여러 단추 추가
- 27. 여러 조건을 추가하는 방법
- 28. 여러 명령을 추가하는 방법
- 29. 여러 행을 추가하는 방법
- 30. CSS : div 안에 가로형 단추 목록을 넣으십시오.
'내가 넌 못하지 Button' 내부에 여러 TextViews을 추가 할 수있는 방법. 버튼이 컨테이너가 아닙니다. 대신 GridView를 사용해보십시오. –