在我的应用程序中,它出现在Android的lints上的这个警告:
可能的透支:根元素绘制背景@ drawable/main,主题也绘制背景(推断的主题是@android:style/Theme)
我想知道如何纠正这个错误,因为在检查和检查互联网后,我发现它正在降低应用程序速度导致它重新加载两倍的背景来放置此源.
这是我的layout.xml的源代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/main"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="120dp"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:text="@string/alta1"
android:textColor="#000"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true"
android:text="@string/alta2"
android:layout_marginLeft="20dp"
android:textColor="#000"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="@+id/continuaralta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView2"
android:layout_marginRight="50dp"
android:layout_marginTop="36dp"
android:textStyle="bold"
android:background="@drawable/boton"
android:text="@string/continuar" />
<Button
android:id="@+id/saliralta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/continuaralta"
android:layout_alignBottom="@+id/continuaralta"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/continuaralta"
android:background="@drawable/boton"
android:textStyle="bold"
android:text="@string/salir" />
Run Code Online (Sandbox Code Playgroud)
当我单击按钮打开文件时,该OpenFileDialog框打开两次.第一个框仅打开图像文件和第二个框文本文件.如果用户决定在不选择文件的情况下关闭第一个框,则也会弹出第二个框.我不确定我在这个问题上的看法.任何帮助,将不胜感激.谢谢!
OpenFileDialog of = new OpenFileDialog();
of.Filter = "All Image Formats|*.jpg;*.png;*.bmp;*.gif;*.ico;*.txt|JPG Image|*.jpg|BMP image|*.bmp|PNG image|*.png|GIF Image|*.gif|Icon|*.ico|Text File|*.txt";
if (of.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
try
{
image1.Source = new BitmapImage(new Uri(of.FileName));
// enable the buttons to function (previous page, next page, rotate left/right, zoom in/out)
button1.IsEnabled = false;
button2.IsEnabled = false;
button3.IsEnabled = false;
button4.IsEnabled = false;
button5.IsEnabled = true;
button6.IsEnabled = true;
button7.IsEnabled = true;
button8.IsEnabled = true;
}
catch (ArgumentException)
{
// Show messagebox when argument exception arises, when …Run Code Online (Sandbox Code Playgroud)