2012-05-23 31 views
0

我設計具有通過按鈕/圖像按鈕DIFF類型functionalies的一個應用程序。最後,名單可能會增加。我想放置一個定製的主頁按鈕,當我在差異化活動時,它始終保持在屏幕上。 或任一,如果你有關於這個主頁按鈕是如何編碼,屏幕下面這個佈局 任何想法。請幫忙。我想修復所有活動的主頁按鈕。

enter image description here

回答

1

你有沒有考慮在Action Bar這恰好爲此而設計的? http://developer.android.com/guide/topics/ui/actionbar.html

+0

我現在回家一個活動,我怎麼可以得到整個項目的差異的活動也。有什麼可能嗎? –

+0

您必須將ActionBar添加到所有活動。爲了更容易,創建一個擴展Activity的BaseActivity類,它封裝了這個功能,然後讓所有的類擴展它。 –

+0

不要考慮ActionBarSherlock:http://actionbarsherlock.com/index.html –

0

您可以放置​​一個按鈕/圖像按鈕/圖像在XML佈局什麼,在該組件上的點擊監聽器設置。您也可以使用選項菜單並在應用程序的所有屏幕上提供多個選項。

+0

1:圖像按鈕:如果我在AbsoluteLayout用於XML它固定在底部(我把回家底部中間),在未來的我必須添加更多的按鈕,因此會造成問題。 –

0

請在上面滾動型,以及滾動視圖下方的圖像,按鈕的佈局。
實施例:

<!-- language: lang-xml --> 
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    > 
    <ScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Your Content Here" 
    /> 
    </ScrollView> 
    <LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <ImageView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ic_launcher" 
    /> 
    </LinearLayout> 
</LinearLayout> 

它看起來像這樣:
Screenshot

相關問題