Facebookアプリのように画面の右からメニューを表示させようとしています。そのためにカスタムビューグループを作成しようとしましたが、その中で何度か説明したコンテンツを更新するときに問題がありますフォーラムと私はまだ助けを見つけていないので、別の方法で試しています.
私の新しいアイデアは、「fill_parent」に2つのものを含む水平線形レイアウトの魔女を持つことです:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/around_selection_content_linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/yellow"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:id="@+id/around_selection_menu_linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
そして、メニューボタンをオーバーライドして、やりたいことを実行しようとしました
myLinearLayout.scrollTo(200,0);
しかし、それは何もしません (理由を説明していただけますか?)
それから私はアニメーションを試しました
TranslateAnimation translateAnimation = new TranslateAnimation(0, 200, 0, 0);
translateAnimation.setDuration(10000);
myLinearLayout.startAnimation(translateAnimation);
しかし、それは何もしません。よく覚えていれば、この場所をクリックすると実際には最初のレイアウトをクリックするため、メニューのボタンはこの方法ではクリックできません。