我正在开发Android 4及更高版本的应用程序.一层生成此警告:此ScrollView布局或其RelativeLayout父级可能无用; 将background属性传递给另一个视图
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp" >
<WebView
android:id="@+id/about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layerType="software" />
</ScrollView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个警告?
我试图找出使用Big O表示法的for循环的复杂性.我之前在其他课程中已经完成了这个,但是这个比其他课程更严格,因为它是在实际的算法上.代码如下:
for(i=n ; i>1 ; i/=2) //for any size n
{
for(j = 1; j < i; j++)
{
x+=a
}
}
Run Code Online (Sandbox Code Playgroud)
我到了第一个循环是O(log_2(n)).至于第二个循环,我有点迷路!感谢您在分析中提供的帮助.
我正在从 png 图像中获取 int 数组,如何将其转换为 bufferdimage 或创建新的 PNG 文件?
int[] pixel = new int[w1*h1];
int i = 0;
for (int xx = 0; xx < h1; xx++) {
for (int yy = 0; yy < w1; yy++) {
pixel[i] = img.getRGB(yy, xx);
i++;
}
}
Run Code Online (Sandbox Code Playgroud)