我的主布局中有一个 GridView,如下所示:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<GridView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:horizontalSpacing="1dp"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
产生这样的网格

每个单元格的内容是这样的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/btn_measurement" >
<Button
android:id="@+id/numerical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="---" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
但我希望第 4 列是其他列的三分之一,但我不能。
我检查了链接:
具有不同列大小的GridView和Android GridView 列拉伸
但他们没有帮助。:(
如果您认为我需要完全更改我的解决方案,请比仅提供一般线索更准确。谢谢
如果您在激活内容辅助时开始输入内容,则内容辅助仅会根据起始字母过滤建议.
但是,假设有一个对象,我们需要查看它的任何方法是否在其名称的任何部分包含特定短语(而不仅仅是检查它们是否以该短语开头).
有没有办法配置内容辅助或是否有任何插件为Eclipse提供该功能?
我有一个扩展FrameLayout的视图,并且需要通知其滚动事件。此视图具有实现GestureDetector的类的实例,该类由重写的onInterceptTouchEvent方法调用。
private class HorizontalScrollListener implements OnGestureListener {
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
...
return false;
}
@Override
public boolean onDown(MotionEvent e) {
...
return false;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return false;
}
@Override
public void onLongPress(MotionEvent e) {
...
System.out.println();
}
@Override
public void onShowPress(MotionEvent e) {}
@Override
public boolean onSingleTapUp(MotionEvent e) { return false; }
}
Run Code Online (Sandbox Code Playgroud)
唯一的问题是,当我尝试滚动时,onDown和onLongPress方法可能会被调用,但实际的onScroll方法却从未被调用。
@Override
public boolean onInterceptTouchEvent(MotionEvent event) { …Run Code Online (Sandbox Code Playgroud) android scroll android-custom-view touch-event android-framelayout
这个 jar 文件是项目构建时在本地生成的。然而,当它被推送到 github 后,它就被损坏了。对本地和下载的 jar 文件运行校验和,它们是不同的。甚至无法提取它。
android ×2
autocomplete ×1
column-width ×1
corruption ×1
eclipse ×1
git ×1
git-push ×1
github ×1
scroll ×1
touch-event ×1