마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

[안드로이드] addView not work / addView 가 먹지않는 이유가 뭘까요 ... 로그도 안나옵니다.

0 추천
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@color/talk_background"
        android:orientation="vertical" >

        <ScrollView
            android:id="@+id/talk_scroll"
            android:layout_width="match_parent"
            android:background="@drawable/bg_chats"
            android:layout_height="match_parent" >

            <LinearLayout
                android:id="@+id/talk_linear"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

                <TextView
                    android:id="@+id/talk_text"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:singleLine="false" />
            </LinearLayout>
        </ScrollView>
    </LinearLayout>

 

----------------------------------------------------------------------------------------------

 

    protected void sendMsg(String msg){
//        View v = ll;
        LayoutInflater vi = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View v = vi.inflate(R.layout.activity_talk_reply, null);
        ViewHolder holder = createHolder(v);
        
        holder.ncnm.setText("나");
        holder.msg.setText(msg);
        
        ll.addView(v);
    }
익명사용자 님이 2016년 2월 26일 질문
ll 이 뭔가요? 선언 안돼서 그런건 아니겠죠?

1개의 답변

0 추천
ViewGroup에만 addview가 됩니다.
익명사용자 님이 2016년 2월 26일 답변
...