Android開發筆記——今天學到的一些屬性

來源:互聯網
上載者:User

   離開實驗室之前再貼上今天下午自己學到的一些基礎知識(上午幹嘛了呢,忙著資料恢複呢  囧):

    1.最後程式打包的時候,res檔案夾中的檔案只有用到的時候才會打包進去,而assets檔案夾中的檔案無論是否用到都要打包進去
    2.安卓主要依靠xml檔案來布局,否則textView多的時候布局起來會比較混亂
    3.android:singleLine屬性為true表示文本在一行顯示
android:ellipsize屬性:設定當文本過長時該如何顯示(顯示省略符號)start、end、middle分別設定省略符號的位置,marquee表示以跑馬燈的形式展示
android:autoLink=“web/email/phone/all”設定超鏈
android:focusable=“true/false”是否可以擷取焦點 
ndroid:focusableInTouchMode="true" 在觸摸的模式下獲得焦點
    4.控制項:
<EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        />預設是要聚焦的,解決方案是在它前面添加一個edittext控制項,寬和高設為0,
android:maxLength="3"屬性限制字元數量,
android:singleLine="false"使其變為多行文字框
android:inputType="number"設定輸入類型
android:hint="13525505014"設定預設顯示資訊

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.