Android --固定底部

來源:互聯網
上載者:User

標籤:

相對布局:

<RelativeLayout    xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context="com.dr.app.drseamoniter.HistoryDataFragment">    <ListView        android:id="@+id/history_data_list"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_above="@+id/history_data_bottom"/>    <LinearLayout        android:id="@+id/history_data_bottom"        android:orientation="horizontal"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:gravity="center"        android:layout_alignParentBottom="true">        <ImageView            android:id="@+id/page_back"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_weight="1"            android:gravity="center"            android:src="@drawable/page_back"/>        <EditText            android:id="@+id/page"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:gravity="center"            android:textSize="12sp"            android:layout_weight="1"/>        <ImageView            android:id="@+id/page_forward"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:gravity="center"            android:layout_weight="1"            android:src="@drawable/page_forward"/>        <TextView            android:id="@+id/total_page_count"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="@string/data_list_page_count"            android:gravity="center"            android:textSize="12sp"            android:layout_weight="1"/>        <TextView            android:id="@+id/total_count"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="@string/data_list_count"            android:gravity="center"            android:textSize="12sp"            android:layout_weight="1"/>    </LinearLayout></RelativeLayout >

參考部落格:Android常見錯誤

 在相對布局中,若是用到android:layout_above屬性,並且其後id之前沒有出現過,那麼需要這樣寫:android:layout_above="@+id/vidAdd_ButtonGroup",多加一個“+”。

Android --固定底部

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.