Skip to content

Android: TextArea and/or Label disappear but clickable with semitransparent background #14365

@Informate

Description

@Informate

I have searched and made sure there are no existing issues for the issue I am filing

  • I have searched the existing issues

Description

If I have a non edibale (editable=false) TextArea or a Label with a long multi-line text (longher than the screen height [FILL] ), inside a scrolling view.
if I set the height to Ti.UI.SIZE and the background to transparent the label or text area is not visible but clickable.

Expected Behavior

The view shows correctly.

Actual behavior

The view is not visible.

Reproducible sample

I am runnig on Android 11, in this example the issue with the label seems related to the semitransparent backgoundcolor,.

// app.js o esempio standalone Titanium

const win = Ti.UI.createWindow({
  backgroundColor: 'red',
  layout: 'vertical'
});

// ScrollView per contenere testo lungo
const scrollView = Ti.UI.createScrollView({
  layout: 'vertical',
  width: Ti.UI.FILL,
  height: Ti.UI.FILL,
  scrollType: 'vertical',
  showVerticalScrollIndicator: true
});

// testo lungo generato con repeat
const longText = ("Lorem ipsum dolor sit amet, \n").repeat(50); // circa 50 righe

// Label non-editable con textAlign Center e height: SIZE
const txt = Ti.UI.createLabel({
  text: longText,
  width: Ti.UI.FILL,
  height: Ti.UI.SIZE,
  borderColor: 'black',
  borderWidth: 2,
  wordWrap: true,
  color: 'black',
  backgroundColor: '#eeffffff',
  textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,
  verticalAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER,
  shadowColor: '#888',
  shadowOffset: { x: 15, y: 15 },
  shadowRadius: 3,
  borderRadius: '2mm',
  bottom: '1.5mm',
  top: 0,
  left: 0,
  right: 0,
  font: { fontSize: '4mm' }
});

// Aggiungo la label allo ScrollView
scrollView.add(txt);

// Aggiungo ScrollView alla finestra
win.add(scrollView);

win.open();

Steps to reproduce

run the code and no text will appear.

Platform

Android

SDK version you are using

13.0.1.GA

Alloy version you are using

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageThis issue hasn't been reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions