从0.52升级到0.59时,黑色标头反应本机

时间:2019-08-14 11:53:09

标签: android react-native

从react native 0.52升级到0.59后,我在android中收到一个奇怪的错误。有一个黑色的标头,我也无法检查。该组件似乎类似于状态栏。我没有为此编写任何代码,但是仍然得到了。以下是我的代码。

app.js

while(SDL_PollEvent(&event)) {
    if(event.type == SDL_WINDOWEVENT) {
        if(event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
            // ...
        }
    }
}

setup.js

f1=open("D:\\bowtie2\\posortowane_cale_test.csv","w")
with open("D:\\bowtie2\\dobazy228k_test.csv") as f:
    for yy in f:
        y=yy.split(";")
        #print(y)
        #sp1=y[1]
    with open ("D:\\bowtie2\\zliczone_test.csv") as f2:
        for xx in f2:
            xx=xx[0:len(xx)-1]
            x=xx.split(";")
        for line in f2:
            sp1=y[0]
            sp2=x[1]
            print("bb")
            if sp1==sp2:
                print("aaa")
                f1.write(x[1]+";"+y[0]+"\n")#";"+x[1]+";"+x[2]+";"+x[3]+";"+x[6]+";"+x[7]+";"+x[8]+";"+sp1+"/"+sp2+"\n")
    f2.close()
f.close()
f1.close()

请参考以下图片以了解错误-enter image description here

1 个答案:

答案 0 :(得分:0)

升级时,我猜想actionbar代码是在styles.xml中生成的。在styles.xml中将DarkActionBar替换为NoActionBar。从修改了我的styles.xml

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
 <item name="android:datePickerDialogTheme">@style/Dialog.Theme</item>
  <!-- Customize your theme here. -->
 <item name="android:timePickerDialogTheme">@style/Dialog.Theme</item>    
</style>

<style name="Dialog.Theme" parent="Theme.AppCompat.Light.Dialog">
     <item name="colorPrimary">#00EEDD</item>
     <item name="colorPrimaryDark">#00EEDD</item>
     <item name="colorAccent">#00EEDD</item>
 </style>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
 <item name="android:datePickerDialogTheme">@style/Dialog.Theme</item>
  <!-- Customize your theme here. -->
 <item name="android:timePickerDialogTheme">@style/Dialog.Theme</item>    
</style>

<style name="Dialog.Theme" parent="Theme.AppCompat.Light.Dialog">
     <item name="colorPrimary">#00EEDD</item>
     <item name="colorPrimaryDark">#00EEDD</item>
     <item name="colorAccent">#00EEDD</item>
 </style>

我通过android studio中的布局检查器检查了我的apk,发现该元素是actionbar。因此,寻找解决方案并找到了这个youtube视频-https://www.youtube.com/watch?v=A9rcKZUm0zM