重新佈置launcher橫屏的佈局

產品的屏是橫放的,但是希望桌面上的Hot seat Button是橫放的。修改了launcher.xml

 

    <RelativeLayout
        android:id="@+id/all_apps_button_cluster"
        android:layout_height="@dimen/button_bar_height"
        android:layout_width="fill_parent"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_marginBottom="@dimen/half_status_bar_height"
        >

        <com.android.launcher3.HandleView
            style="@style/HotseatButton"
            android:id="@+id/all_apps_button"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            android:src="@drawable/all_apps_button"
            launcher:direction="horizontal"
            />

 

以及styles.xml

 

    <style name="HotseatButton">
        <item name="android:paddingTop">12dip</item>
        <item name="android:paddingBottom">12dip</item>
        <item name="android:background">@drawable/hotseat_bg_center</item>
        <item name="android:layout_height">fill_parent</item>
        <item name="android:layout_width">wrap_content</item>
        <item name="android:scaleType">center</item>
        <item name="android:focusable">true</item>
        <item name="android:clickable">true</item>
    </style>

 

將其它ImageView改爲android:layout_toRightOf="@id/all_apps_button"或者android:layout_toRightOf="@id/all_apps_button"就可以了。

加了幾個Hot seat Button,要和launchHotSeat關聯上,還沒有看,現在給領導和業務員演示沒有什麼問題了。

在模擬器和真機上都可以用了。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章