<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. Android(安卓)Layout 属性大全
  2. tools:context=".MainActivity的作用
  3. tools:context=".MainActivity的作用
  4. default locale 设置地区
  5. 工具收藏
  6. Android--ListView 分割线
  7. 有关XML的点击状态背景图的设置
  8. 【Android】使用MediaCodec硬编码实现视频直播推流端(一)
  9. android手电筒开发

随机推荐

  1. golang是多线程模式吗?
  2. Go如何使用websocket实现弹幕功能
  3. golang是单进程的吗?
  4. golang如何释放map内存?
  5. 代码详解使用Go基于WebSocket构建视频直
  6. golang如何处理输入?
  7. PHP语法和Go语法有什么差异?对比介绍
  8. golang如何调用函数?
  9. golang是面向对象吗?
  10. 用Go实现字符串的逆序