小编Gun*_*lan的帖子

如何获取分组的Kendo网格中所选行的索引和数据

我正在尝试访问行索引,如下所示:

var grid = $("#grid").data("kendoGrid");
alert(grid.select().index());
Run Code Online (Sandbox Code Playgroud)

我在这个jsfiddle链接中添加了我的代码.这个代码在我的系统中工作,我不知道为什么 deleteRecord()没有在jsfiddle中调用方法,但这不是实际的问题.

在这里点击最后一行的取消按钮提醒消息时会将索引显示为8,但实际索引为4.每个按钮只给我错误的索引.

javascript jquery html5 kendo-ui kendo-grid

6
推荐指数
1
解决办法
3万
查看次数

Camera2Basic app前置摄像头拍摄照片

我试过谷歌的android-Camera2Basic示例应用程序.对于前置摄像头,我在Camera2BasicFragment中更改了一些代码.变化如下.

要切换到的前置摄像头我已经改变mCameraId = cameraId;mCameraId = "1";setUpCameraOutputs(int width, int height)方法.

并添加如果条件在结束时setUpCameraOutputs(int width, int height),

if(mCameraId == null)
    mCameraId = cameraId;
Run Code Online (Sandbox Code Playgroud)

此更改完美显示前置摄像头,但不选择照片.所以我换了

mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback,
                        mBackgroundHandler);
Run Code Online (Sandbox Code Playgroud)

captureStillPicture();
Run Code Online (Sandbox Code Playgroud)

lockFocus().现在前置摄像头拍摄照片,但它看起来颠倒了.

例如:

样本图像

我现在不知道该怎么办.

我的要求是使用camera2 api在两个摄像头中捕捉照片.所以,如果我做错了什么,请纠正我.

在某些设备中,此应用程序只需单击即可拍摄多张照片.

camera android android-camera2

6
推荐指数
1
解决办法
459
查看次数

VOLUME_EXTERNAL 需要 API 级别 29

Android 文档中他们说

在 API <= 28 上,使用 VOLUME_EXTERNAL

但这也需要 API 级别 29,并且它不会将媒体文件保存到 MediaStore 中。

 MediaStore.Audio.Media.IS_PENDING
 MediaStore.Video.Media.RELATIVE_PATH
 MediaStore.Video.Media.DATE_TAKEN
Run Code Online (Sandbox Code Playgroud)

还需要 API 29,所以我觉得文档不清楚,或者有什么我错过的吗?以及如何在 Android 10 以下保存媒体文件。

android mediastore

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

如何使用 Flutter GetX 侧边栏

如何使用GetX在 Flutter 中实现图像(侧边栏和导航菜单)中的设计?类似于网络上的选项卡。使用 GetX 颤动侧边栏

flutter flutter-getx

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

带有微调器的Android Listview和一个复选框

我是android开发的新手.我正在尝试创建一个包含微调器,编辑文本和复选框的List.微调器和复选框的数据来自数据库.我有以下文件.

NewTransac class which extends ListActivity {

private PayDbAdapter mDbHelper;
private  Spinner paySpinner;
private CheckBox mCheckBox;

@Override
protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.new_transac_listview);
     mDbHelper = new PayDbAdapter(this);
     mDbHelper.open();

     populatedata();
}

private void populatedata() {

    paySpinner = (Spinner)findViewById(R.id.payerspinner);
    mCheckBox = (CheckBox)findViewById(R.id.paidforcheckboxname);

    Cursor mCursor = mDbHelper.fetchAllTransactionValue();
    startManagingCursor(mCursor);

    // Create an array to specify the fields we want to display in the list.
    String[] from = new String[]{PayDbAdapter.KEY_NAME};

    int[] to = new int[]{android.R.id.text1};
    int[] cbto = new int[]{R.id.paidforcheckboxname};

    // Now create a …
Run Code Online (Sandbox Code Playgroud)

checkbox android listview android-edittext

4
推荐指数
1
解决办法
3万
查看次数

两侧都有NavigationView

我需要用不同的菜单打开两侧的导航视图.另外我需要更改导航图标(目前有三条水平线).如果我可以通过单独的按钮单击打开nav_view并且na_view2这些按钮在我的工具栏中可用,或者我需要知道如何在两侧设置单独的图标,这样会更好.

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/activity_main_drawer" />

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view2"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="end"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/activity_main_drawer1" />

</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)

任何帮助都会非常值得一提.

android navigation-drawer

4
推荐指数
1
解决办法
2110
查看次数

Progressdialog isshowing返回true,甚至称为hide

我已经创建了这样的进度对话框

public VolleyService(Context context, VolleyServiceCompletedListener listener){
    this.context = context;
    pDialog = new ProgressDialog(context);
    pDialog.setMessage("Loading...");
    pDialog.setCancelable(false);
    this.listener = listener;
}
Run Code Online (Sandbox Code Playgroud)

并尝试使用此方法显示进度对话框.

private void showProgressDialog() {
    boolean isShowing = pDialog.isShowing();
    if (!isShowing)
        pDialog.show();
}
Run Code Online (Sandbox Code Playgroud)

并使用此方法隐藏对话框.

private void hideProgressDialog() {
    if (pDialog.isShowing()) {
        pDialog.hide();
    }
} 
Run Code Online (Sandbox Code Playgroud)

pDialog.isShowing()即使在我调用之后,问题也会返回true pDialog.hide().当我看到hide()方法时,android.app.Dialog.java他们没有将mShowing变量赋值为false,但是当我调用show()它们时,它们将mShowing变量赋值为true.

那么他们有什么理由不做假的吗?我怎样才能再次打开相同的进度对话框?

android

4
推荐指数
1
解决办法
1517
查看次数

具有 StrokeWidth 的 ShapeableImageView,所有四个边都修剪了 Stroke

今天我刚从ShapeableImageViewMaterial design 中尝试过,

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/GuidelineTop"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.15" />

    <com.google.android.material.imageview.ShapeableImageView
        android:id="@+id/imgProfile"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:scaleType="centerCrop"
        app:strokeColor="@color/grey400"
        app:strokeWidth="@dimen/dp3"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        android:adjustViewBounds="true"
        app:layout_constraintTop_toBottomOf="@+id/GuidelineTop"
        app:shapeAppearanceOverlay="@style/circleImageView" />
</androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

还有我的circleImageView

<style name="circleImageView" parent="">
    <item name="cornerFamily">rounded</item>
    <item name="cornerSize">50%</item>
</style>
Run Code Online (Sandbox Code Playgroud)

这是示例屏幕截图。

在此处输入图片说明

如您所见,笔画在左侧、顶部、右侧、底部被截断。有什么我错过的吗?

android

4
推荐指数
1
解决办法
840
查看次数

自定义进度条为Android

是否可以像下面的图像一样进行进度条.

在此输入图像描述

明星必须通过给予百分比来填补.任何帮助都会非常值得一提.谢谢.

java android canvas android-progressbar

3
推荐指数
1
解决办法
567
查看次数

在recyclerview中停止滚动

我需要在recyclerview中修改滚动,如果用户只删除其中一个可见视图,我想在可用位置显示不可见的视图.我试过以下事情,

添加

android:overScrollMode="never"
Run Code Online (Sandbox Code Playgroud)

在xml上,和

recyclerView.setHasFixedSize(false);
Run Code Online (Sandbox Code Playgroud)

在Java上,但没有任何帮助,任何帮助将是非常值得注意的.

谢谢.

更新

我想禁用滚动选项,用户只能在删除其中一个可见项后才能看到隐藏项.

android android-recyclerview

3
推荐指数
1
解决办法
8383
查看次数