小编Asi*_* Sb的帖子

如何在android中滚动子滚动视图时停止滚动父滚动视图?

我知道我们可以在两个滚动视图中使用touchlisteners

parentScrollView.setOnTouchListener(new View.OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
    Log.v(TAG, "PARENT TOUCH");

    findViewById(R.id.child_scroll).getParent()
            .requestDisallowInterceptTouchEvent(false);
    return false;
    }
});

childScrollView.setOnTouchListener(new View.OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
    Log.v(TAG, "CHILD TOUCH");

    // Disallow the touch request for parent scroll on touch of  child view
    v.getParent().requestDisallowInterceptTouchEvent(true);
    return false;
    }
});
Run Code Online (Sandbox Code Playgroud)

我面临的是我的子滚动视图不是父滚动视图的直接子项.这v.getParent()不起作用,当我触摸并尝试滚动我的子滚动视图时,整个主滚动滚动.

我的滚动视图在我的布局中的位置(视图是动态创建的,因此我需要使用这么多布局)

linearLayout
  ParentscrollView(0)
          linearLayout(0)
              relativeLayout(0)
                       TextView(0)
              relativeLayout(1)
                    childScrollView(0)
Run Code Online (Sandbox Code Playgroud)

需要帮助.谢谢.!!

android scroll

7
推荐指数
1
解决办法
2704
查看次数

选择后,为每颗星定制评级栏,其中包含不同的自定义图像

例如,我有一个5星相同的评级栏.当我滑过或触摸任何一颗星时,它会将所有星星从正常变为某种颜色,因为它表示它被评级.

我想要的是,有没有可能我们可以为评级栏的每颗星而不是5颗相同的星星提供5个独特的图像?

像第一颗星是太阳图像,第二颗星是月亮图像,第三颗星是一些方形图像等.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" >

       <RelativeLayout 
            android:id="@+id/rl_rating"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp" >
            <RatingBar
               android:id="@+id/ratingBar"
               android:layout_width="wrap_content"
               android:layout_height="78dp"
               style="@style/CustomRatingBar" />
    </RelativeLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

android ratingbar

7
推荐指数
0
解决办法
1021
查看次数

无法在eclipse中导入凌空库

我刚刚从下面的链接获得了凌空图书馆.. git clone- https://android.googlesource.com/platform/frameworks/volley 在eclipse我正在按照步骤 导入> git>项目从git> ....等

并且库已在C:\ Users\active\git\volley中下载

当我只想将volley文件夹导入eclipse(C:\ Users\active\git\volley)时,它在IMPORT PROJECT中显示" 选择至少一个项目 ".他们只是一个项目,虽然我选择了它仍然是在顶部显示相同的错误..非常需要帮助...在此先感谢

eclipse git android

5
推荐指数
1
解决办法
5211
查看次数

如何减少Android中弹出菜单的宽度?

我已经在列表视图的每个项目上实现了弹出菜单,问题是当我点击打开弹出菜单的图像视图时。弹出菜单的宽度太大。

我需要减少弹出菜单的宽度。到目前为止,我已经减少了高度、文本大小、文本颜色、分隔符大小和颜色以及背景颜色。

通过修改 style.xml(v-14 和 v-11 的值文件夹)中的以下更改:

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <!-- API 14 theme customizations can go here. -->

    <item name="android:dropDownListViewStyle">@style/PopupMenuListView</item>
    <item name="android:actionBarWidgetTheme">@style/PopupMenuTextView</item>
    <item name="android:popupMenuStyle">@style/PopupMenu</item>

    <!-- Change Overflow Menu ListView Item Height & Property -->
    <item name="android:listPreferredItemHeightSmall">30dp</item>
    <item name="android:listPreferredItemPaddingLeft">5dp</item>
    <item name="android:listPreferredItemPaddingRight">5dp</item>
</style>

<!-- Change Overflow Menu ListView Divider Property -->
<style name="PopupMenuListView" parent="@android:style/Widget.Holo.ListView.DropDown">
    <item name="android:divider">#dcdbdb</item>
    <item name="android:dividerHeight">2dp</item>
</style>

<!-- Change Overflow Menu ListView Text Size and Text Size -->
 <style name="PopupMenuTextView" parent="@style/android:Theme.Holo.Light">
    <item name="android:textColor">#00FF00</item>
    <item name="android:textSize">15sp</item>
</style>

 <!-- Change Overflow …
Run Code Online (Sandbox Code Playgroud)

xml android listview popupmenu

5
推荐指数
0
解决办法
5452
查看次数

如何在Android中获取文本视图的"幻灯片解锁"动画?

有没有办法在Android中我可以实现幻灯片解锁Android中的动画?我有一个文本视图,我想在其上制作动画!这是我的布局:

<LinearLayout
                android:id="@+id/ll_chooseLang"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="5dp"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/tv_chooseLanguage"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:lineSpacingMultiplier="1.2"
                     android:textColor="#fff"
                     android:textSize="25sp"
                    android:text="TextView" />

            </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我已经淡出并淡出动画:

animSet=new AnimationSet(true);
    trans=new TranslateAnimation(400, 0,0, 0);
    trans.setDuration(2000);

    fadeIn=new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setDuration(1800);
    fadeIn.setFillAfter(true);
    fadeout=new AlphaAnimation(1.0f, 0.0f);
    fadeout.setDuration(2000);
    fadeout.setFillAfter(true);

    animSet.addAnimation(trans);
    animSet.addAnimation(fadeIn);
Run Code Online (Sandbox Code Playgroud)

但我希望动画像"滑动解锁".我搜索了很多,无法满足我的要求..

需要帮助,提前谢谢.. !!

animation android

0
推荐指数
1
解决办法
1147
查看次数

标签 统计

android ×5

animation ×1

eclipse ×1

git ×1

listview ×1

popupmenu ×1

ratingbar ×1

scroll ×1

xml ×1