<TableLayout  xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1" android:padding="5dip"> <TableRow>     <TextView         android:id="@+id/label1"         android:text="@string/label1text"         android:layout_column="0"         style="@style/label"         />     <EditText          android:id="@+id/edit1"         android:layout_column="1"         style="@style/edit"         /> </TableRow>

<style name="label" parent="@android:style/Widget.TextView">     <item name="android:gravity">right</item>     <item name="android:paddingRight">5dip</item>     <item name="android:paddingTop">15dip</item>     <item name="android:layout_width">wrap_content</item>     <item name="android:layout_height">wrap_content</item> </style> <style name="edit" parent="@android:style/Widget.EditText">     <item name="android:layout_width">fill_parent</item>     <item name="android:layout_height">0</item> 
    <item name="android:layout_weight">1</item>    <item name="android:scrollHorizontally">true</item>     <item name="android:fadingEdge">vertical</item>     <item name="android:inputType">text</item> </style> 

红色部分就是要设置的。

 <TableLayout android:id="@+id/homelayout"                         android:layout_width="fill_parent" android:layout_height="fill_parent">                         <TableRow>                         <TextView android:id="@+id/labelartist"                                 android:layout_width="fill_parent" android:layout_height="wrap_content"                                 android:text="Find artists:" />                         </TableRow>                         <TableRow>                                 <EditText android:id="@+id/entryartist"                                         android:layout_width="wrap_content" android:layout_height="0"                                         android:background="@android:drawable/editbox_background"                                         android:singleLine="true"                                         android:editable="true"                                         android:layout_weight="3"                                         android:padding="5px"                                          />                                  <Button android:id="@+id/okartist" android:layout_width="wrap_content"                                         android:layout_height="wrap_content"                                         android:layout_alignParentRight="true" android:layout_marginLeft="10dip"                                         android:layout_weight="1"                                         android:text="Search" />                         </TableRow>                 </TableLayout> 

更多相关文章

  1. phpmyadmin表前出现红色感叹号
  2. hibernate(*.hbm.xml)中新添加的字段被标记为红色(找不到)的解决方法
  3. R.java was modified manually! Reverting to generated version

随机推荐

  1. Android(安卓)中的WiFi学习笔记——经典
  2. MediaBrowserService 音乐播放项目--IT蓝
  3. Android-----js和android的互调
  4. [Xamarin.Android] Fragment Tips
  5. Android(安卓)Studio 错误大全
  6. android获取网络图片的用法
  7. Android新特性介绍
  8. 多式样ProgressBar
  9. 图片中的毕加索【Picasso】
  10. android ndk 04 C语言 结构体_结构体指针