AnnBnnCnnD 2013-04-07 03:29 采纳率: 0%
浏览 5938
已采纳

编辑文本在左上方开始

EditText如下:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:inputType="textMultiLine"
        android:lines="5"
        android:singleLine="false"
        android:text="@string/app_name" />
</LinearLayout>

但是开始的位置是在EditText中间开始。

怎么样在左上方开始?

  • 写回答

1条回答

  • loFataMer 2013-04-07 07:15
    关注

    试试android:gravity="top":

    <EditText
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:gravity="top"
         android:inputType="textMultiLine"
         android:lines="5"
         android:singleLine="false"
         android:text="@string/app_name" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导