小编Are*_*ons的帖子

错误:在依赖项更新后找不到符号方法getMap()

更新我的依赖项后,我的getMap()将无法正常工作.(它曾经在更新前工作得很好)

这是我得到错误的代码行

GoogleMap map = ((MapView) mRootView.findViewById(R.id.fragment_map_mapview)).getMap();

Location locationNet = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
Location locationGps = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
Run Code Online (Sandbox Code Playgroud)

爷爷的代码

dependencies
        {
            compile 'com.android.support:support-v4:24.0.0'
            compile 'com.android.support:appcompat-v7:24.0.0'
            compile 'com.android.support:cardview-v7:24.0.0'
            compile 'com.android.support:recyclerview-v7:24.0.0'
            //compile 'com.google.android.gms:play-services:7.3.0'
            compile 'com.google.android.gms:play-services:9.2.0'
            compile 'com.afollestad:material-dialogs:0.6.3.4@aar'
            compile 'com.bignerdranch.android:recyclerview-multiselect:0.1'
            compile 'com.j256.ormlite:ormlite-android:4.48'
            compile 'com.melnykov:floatingactionbutton:1.2.0'
            compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
            compile 'se.emilsjolander:StickyScrollViewItems:1.1.0'
            compile 'com.squareup.picasso:picasso:2.5.2'
            compile fileTree(include: ['*.jar'], dir: 'libs')
        }
Run Code Online (Sandbox Code Playgroud)

dependencies android google-maps android-gradle-plugin

9
推荐指数
1
解决办法
9202
查看次数

视觉扫描无法识别 iOS16 上的 GS1 条形码特殊字符

我们正在使用Vision库来扫描 GS1 条形码。

该库无法识别 iOS 16 版本中的特殊字符“GS”。

"GS" --> 组分隔符 (ASCII 29)

我们在旧版本上没有遇到这样的问题。例如 iOS 15.6 或更低版本。我在下面上传了 GS1 条形码示例图像。

扫描后我们应该得到:{GS}10BF50001A{GS}21003032{GS}1122012722VD020

我们在 iOS 16 上得到的是:10BF50001A210030321122012722VD020

我还发布了有关如何使用该库的示例代码。我们没有更改代码,该错误仅出现在 iOS 16 版本上。我们想知道是否引入了错误。

func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
    guard let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else {
        return
    }

    let imageRequestHandler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer, orientation: .right)

    do {
        try imageRequestHandler.perform([detectBarcodeRequest])
    } catch {
        logger.error(tag: TAG, "barcode error: \(error)")
    }
}

private lazy var detectBarcodeRequest = VNDetectBarcodesRequest { [weak self] request, …
Run Code Online (Sandbox Code Playgroud)

barcode ios swift ios16 gs1-qr-code

9
推荐指数
1
解决办法
755
查看次数

RecyclerView.Adapter在一行中显示2个项目(如何更改)

所以我正在开发一个已经包含一些代码的项目.我想改变我的适配器项目的显示方式.

现在每行有2个项目.我想要做的是每行只有1个项目.

这是一个图像布局现在如何的图像. http://i68.tinypic.com/2wqd2rp.png

每行显示2个项目,而我只需要显示1个项目.

这是xmls上的代码

项目xml

<com.inthessaloniki.cityguide.view.SelectorRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_poi_list_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:listSelector="@drawable/selector_clickable_item_bg_inverse">
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/fragment_poi_list_item_image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="fitXY"/>

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

列出xml

<FrameLayout
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"
android:animateLayoutChanges="true">

<LinearLayout
    android:id="@+id/container_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/fragment_poi_list_recycler"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:scrollbars="vertical"
        android:background="@color/global_bg_front" />

    <com.google.android.gms.ads.AdView
        android:id="@+id/fragment_poi_list_adview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:adUnitId="@string/admob_unit_id_poi_list"
        app:adSize="BANNER" />

</LinearLayout>

<include
    layout="@layout/placeholder_progress"
    android:id="@+id/container_progress"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone" />

<include
    layout="@layout/placeholder_offline"
    android:id="@+id/container_offline"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone" />

<include
    layout="@layout/placeholder_empty"
    android:id="@+id/container_empty"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone" />
Run Code Online (Sandbox Code Playgroud)

ListAdapter代码

public class SubCategoryListAdapter extends …
Run Code Online (Sandbox Code Playgroud)

xml android android-layout android-adapter

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