2011-11-22 44 views
2

我想創建一個Android視圖,但即時通訊掙扎。所以希望有人可以幫助:Android UI中的Excel看起來行爲

基本上它是一個表,但最左邊的列不應滾動,其餘應滾動。就像Excel一樣。即使您滾動到第XX列,最左邊的列(所有數字都增加)也不會消失。

有關如何實現此目的的任何線索?原因是最左邊的列將是一個鍵列表,其餘列將是值。在女士

+0

你已經嘗試過(和失敗)的一些做法?知道 –

+1

將會很有趣。視圖行爲的草圖將會有所幫助。 –

回答

1

A scetch of what I was trying to do

用我萊特技能塗料我畫了這件事情。所以想法是,當你上下滑動時......所有東西都會滾動......但是當你左右滑動時,只有右邊的桌子會移動。左邊是靜態的。

我將在這裏添加源以及:

<LinearLayout 
android:id="@+id/widget60" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:scrollbars="vertical" 
> 
<TableLayout 
android:id="@+id/schedule_stops" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:clickable="true" 
android:layout_alignParentTop="true" 
android:layout_alignParentLeft="true" 
> 
</TableLayout> 
<HorizontalScrollView 
android:id="@+id/widget69" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_alignParentTop="true" 
android:layout_toRightOf="@id/schedule_stops" 
> 
<TableLayout 
android:id="@+id/schedule_times" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:clickable="true" 
> 
</TableLayout> 
</HorizontalScrollView> 
</LinearLayout> 

的關鍵是使用Horizo​​ntalScrollView而不是普通的滾動型

相關問題