2016-09-05 11 views
0

私は私のプロジェクトでのGoogleマップのAPIを使用して、私はこのコードでズームコントロールの位置を変更したい:Googleマップのズームイン/アウトコントロールの位置を変更するにはどうすればよいですか?

SupportMapFragment mapFrag = (SupportMapFragment) getSupportFragmentManager() 
      .findFragmentById(R.id.map); 
    // Find ZoomControl view 
    final View zoomControls = mapFrag.getView().findViewById(0x1); 

(このコードのみのビルド、デバッグ のために私の作品と私はリリースを構築したいとき0x1

Error:Error: Expected resource of type id [ResourceType]

このエラーポイント:署名されたAPK)は、このコードは、エラーを有しています。

どうすればいいですか?

+0

私は同様の問題がありました。私は組み込みのコントロールを無効にし、組み込みのコントロールに似た独自のコントロールビューを作成しました。 – Lev

+0

エラーは何ですか? –

+0

エラー:エラー:タイプIDの予想されるリソース[ResourceType] – miladsolgi

答えて

1

デバッグビルドで動作しているため、エラーはビルドリリース(APKに署名)にのみ存在するため、build.gradleでlintルールを無効にしてみてください。

To rectify this issue first press on the error to see which file throws this error. Once inside the file, inside the class function type this:

@SuppressWarnings("ResourceType")

Then head over to your app’s build.gradle file and under defaultConfig type this:

android { 
    lintOptions { 
    disable "ResourceType" 
    } 
} 

出典:Android — Error: Expected resource of type styleable [ResourceType] error

関連する問題