나는 다음과 같은 View
을 가지고 있으며, 그것에 TextView
을 추가하고 싶습니다. 누구든지 어떻게 할 수 있는지 알고 있습니까?사용자 정의 안드로이드보기에 textView 추가
public class ProgressView extends View {
TextView text;
public ProgressView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
text = new TextView(getContext());
text.setText("Hello");
// How can I add this to the view now??
}
@Override
protected void onDraw(final Canvas canvas) {
}
}
ViewGroup을 확장 할 수 있습니다. – kalabalik
좋은 전화는 내가 그렇게 생각하지 않았다는 것을 믿을 수 없다. 이 답변을 게시하면 내가 수표를 드리겠습니다. – hermt2
실제로 그 일을 할 때 내보기가 표시되지 않습니다. – hermt2