布局没啥特别的 <EditText android:id="@+id/embedded_text_editor" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:autoText="true" android:capitalize="sentences" android:hint="@string/type_to_compose_text_enter_to_send" android:textCursorDrawable="@null" android:textColor="@android:color/black" android:maxLines="4" android:nextFocusRight="@+id/send_button" android:gravity="top" />
int newHeight = 200; //注意这里,到底是用ViewGroup还是用LinearLayout或者是FrameLayout,主要是看你这个EditTex //控件所在的父控件是啥布局,如果是LinearLayout,那么这里就要改成LinearLayout.LayoutParams ViewGroup.LayoutParams lp = editText.getLayoutParams(); lp.height = newHeight; editText.setLayoutParams(lp);
|