从chrome打印我的Angular AGM Map我在地图中得到了这个大的灰色间隙:
正如你所看到的,不仅是那里的灰色条(如果我关闭"背景图形"它会变成白色),但它也会将地图图像移到它下面
以下是重现此问题所需的简单代码:
app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<button (click)="clickPrint()">print</button>
<agm-map id="Gmap" [latitude]="34.051759" [longitude]="-118.244576" [zoom]="17"></agm-map>
`,
styles: [`
agm-map {
height: 800px; //height: 100%;
}
button {
position: absolute;
z-index: 10;
}
`]
})
export class AppComponent {
clickPrint() {
print()
}
}
Run Code Online (Sandbox Code Playgroud)
app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AgmCoreModule } from '@agm/core'
@NgModule({ …Run Code Online (Sandbox Code Playgroud) android keyboard-shortcuts keymapping android-studio visual-studio-code
如何将文件附加到现有的 zip 文件?我已经有了可以创建 zip 文件的代码,除了一个大问题外,它运行良好。现在的工作方式是,用户拍摄一堆照片,最后,所有照片都被添加到一个 zip 文件中,如果你拍了足够多的照片,这可能需要相当长的时间。:-( 所以我在想,我有一个非常好的和有效的解决方案。在拍摄照片时,我会在拍摄后立即将每张新照片添加到 zip 文件中。然后当他们完成拍照时,完成 zip 文件,使其可用并导出。:-)
问题是,我无法将文件添加到现有的 zip 文件中。:-( 这是我到目前为止所拥有的。另外,请记住,这只是一个概念证明,我确实理解为 for 循环的每次迭代重新初始化所有内容是非常愚蠢的。循环的每次迭代都是应该代表正在添加的另一个文件,这很可能会在很长时间之后,甚至可能是一个小时之后,这就是为什么我每次迭代都重置所有内容,因为该应用程序将在添加文件之间关闭。如果我能让这个工作,然后我实际上会放弃 for 循环并将此代码放入每次拍摄照片时都会调用的函数中。:-)
try {
for(int i=0; i < _files.size(); i++) {
//beginning of initial setup stuff
BufferedInputStream origin = null;
FileOutputStream dest = new FileOutputStream(_zipFile,false);
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest));
byte data[] = new byte[BUFFER];
out.setLevel(0); //I added this because it makes it not compress the data
//at all and I hoped that it would allow the zip to be appended …Run Code Online (Sandbox Code Playgroud) 我创建了一个应用程序,用于创建 gpx 文件。除了共享之外,一切正常。因此我创建了一个文件提供程序。您可以在下面看到它的配置。Provider 在我运行 Android 8.0.0 的 android 设备上运行良好,但在朋友 Huawei (6.0) 上它不工作
Fatal Exception: java.lang.IllegalArgumentException
Failed to find configured root that contains /storage/8737-15E4/Android/data/XXX/cache/20171009_171900.gpx
Run Code Online (Sandbox Code Playgroud)
清单中的提供者:
<provider
android:name=".GenericFileProvider"
android:authorities="com.package.test.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
Run Code Online (Sandbox Code Playgroud)
文件路径.xml:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="external-files" path="/" />
<external-cache-path name="cache-files" path="/" />
</paths>
Run Code Online (Sandbox Code Playgroud)
代码中的用法:
File gpxFile = new File(context.getExternalCacheDir(), "20171009_171900.gpx");
Uri gpxContentUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", gpxFile);
Intent gpxIntent = new Intent(Intent.ACTION_SEND);
gpxIntent.setType("text/gpx");
gpxIntent.putExtra(Intent.EXTRA_STREAM, gpxContentUri);
Intent programChooser = Intent.createChooser(gpxIntent, context.getString(R.string.select_app_to_share));
programChooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
activityForDialog.startActivity(programChooser);
Run Code Online (Sandbox Code Playgroud)
我希望有人能帮我找到导致应用程序在某些设备上崩溃的错误...
我试图这样做,当用户按下一个按钮时,会显示一个DateTimePicker对话框,我甚至想得到他们选择的结果日期.这是我到目前为止所拥有的:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Dis As System.Windows.Forms.DateTimePicker = New System.Windows.Forms.DateTimePicker()
' Set the MinDate and MaxDate.
Dis.MinDate = New DateTime(1985, 6, 20)
Dis.MaxDate = DateTime.Today
' Set the CustomFormat string.
Dis.CustomFormat = "MMMM dd, yyyy - dddd"
Dis.Format = Windows.Forms.DateTimePickerFormat.Custom
' Show the CheckBox and display the control as an up-down control.
Dis.ShowCheckBox = True
Dis.ShowUpDown = True
Dis.Show()
End Sub
Run Code Online (Sandbox Code Playgroud)
但是当我按下按钮并运行代码时,没有任何内容显示出来.我认为应该有一种简单地以编程方式显示此对话框的方法.有人可以帮我吗?:-)
仅供参考,如果有任何帮助,我在VB 2010中对此进行编码?: - \