Изображение не отображается в галерее после сохранения

Назначить непрозрачность 1.0 рекурсивно с помощью:

div > div { opacity: 1.0 }

Пример:

div.x { opacity: 0.5 }
div.x > div.x { opacity: 1.0 }
<div style="background-color: #f00; padding:20px;">
  <div style="background-color: #0f0; padding:20px;">
    <div style="background-color: #00f; padding:20px;">
      <div style="background-color: #000; padding:20px; color:#fff">
         Example Text - No opacity definition
      </div>
    </div>  
  </div>
</div>
<div style="opacity:0.5; background-color: #f00; padding:20px;">
  <div style="opacity:0.5; background-color: #0f0; padding:20px;">
    <div style="opacity:0.5; background-color: #00f; padding:20px;">
      <div style="opacity:0.5; background-color: #000; padding:20px; color:#fff">
        Example Text - 50% opacity inherited
      </div>
    </div>  
  </div>
</div>
<div class="x" style="background-color: #f00; padding:20px;">
  <div class="x" style="background-color: #0f0; padding:20px;">
    <div class="x" style="background-color: #00f; padding:20px;">
      <div class="x" style="background-color: #000; padding:20px; color:#fff">
         Example Text - 50% opacity not inherited
      </div>
    </div>  
  </div>
</div>
<div style="opacity: 0.5; background-color: #000; padding:20px; color:#fff">
  Example Text - 50% opacity
</div>

0
задан Aditya Vyas-Lakhan 16 January 2019 в 12:12
поделиться

1 ответ

Я использовал этот код, и он работает для меня:

// show the image in the device gallery
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        val mediaScanIntent = Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE)
        val contentUri = Uri.fromFile(compressFile) //out is your output file
        mediaScanIntent.data = contentUri
        this.sendBroadcast(mediaScanIntent)
    } else {
        sendBroadcast(Intent(Intent.ACTION_MEDIA_MOUNTED,
                Uri.parse("file://" + Environment.getExternalStorageDirectory())))
    }// // show the image in the device gallery
0
ответ дан Rozina 16 January 2019 в 12:12
поделиться
Другие вопросы по тегам:

Похожие вопросы: