0
因此,我試圖在臭名昭着的滑出菜單中對我進行破解,如在G +和Youtube中。 在這個原因中,我設置了一個我想用來打開側面菜單的ActionBar UP按鈕。 我已經正確地佈置了所有的東西,但是當我詢問時,我的HorizontalScrollView不滑動。水平菜單滑出滾動不被稱爲
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<include
android:layout_width="wrap_content"
layout="@layout/side_menu" />
<HorizontalScrollView
android:id="@+id/menu_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="horizontal" >
<include
layout="@layout/main_content" />
</HorizontalScrollView>
</FrameLayout>
private void toggleSideMenu() {
mMenuScrollView.postDelayed(new Runnable() {
@Override
public void run() {
int menuWidth = mSideMenu.getMeasuredWidth();
if (!mIsMenuVisible) {
// Scroll to 0 to reveal menu
int left = 0;
mScrollView.smoothScrollTo(left, 0);
} else {
// Scroll to menuWidth so menu isn't on screen.
int left = menuWidth;
mScrollView.smoothScrollTo(left, 0);
}
mIsMenuVisible = !mIsMenuVisible;
}
}, 50);
}
我打電話給smoothScroll似乎沒有工作。