<relativeLayout androID:layout_height="wrap_content" androID:layout_wIDth="fill_parent" androID:paddingtop="10dp"> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="To: " androID:textcolor="#000000" androID:paddingtop="10dp" androID:layout_toleftOf="@+ID/editText_recipIEnt" androID:layout_alignParentleft="true" androID:layout_marginleft="10dp"/> <EditText androID:ID="@+ID/editText_recipIEnt" androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content" androID:hint="Enter Number" androID:inputType="number" androID:textSize="12sp" androID:layout_toleftOf="@+ID/button_recipIEnt_picker" androID:layout_marginleft="5dp"/> <button androID:ID="@+ID/button_recipIEnt_picker" androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content" androID:text="browse .." androID:layout_alignParentRight="true" androID:layout_marginleft="5dp" androID:layout_marginRight="5dp" androID:onClick="dolaunchContactPicker"/> </relativeLayout>解决方法
<linearLayout androID:layout_height="wrap_content" androID:layout_wIDth="fill_parent" androID:paddingtop="10dp"> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="To: " androID:textcolor="#000000" androID:paddingtop="10dp" androID:layout_marginleft="10dp"/> <EditText androID:ID="@+ID/editText_recipIEnt" androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content" androID:hint="Enter Number" androID:inputType="number" androID:textSize="12sp" androID:layout_marginleft="5dp" androID:layout_weight="1" /> <button androID:ID="@+ID/button_recipIEnt_picker" androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content" androID:text="browse .." androID:layout_marginleft="5dp" androID:layout_marginRight="5dp" androID:onClick="dolaunchContactPicker"/> </linearLayout>
使用此布局,我将您的布局转换为线性(水平默认).并为editText添加了layout_weight,它将占用剩余的空间.
总结以上是内存溢出为你收集整理的android – EditText不会填满余下的空间全部内容,希望文章能够帮你解决android – EditText不会填满余下的空间所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)