Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20364] Android: CardView can't display child view

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-09-16T21:52:34.000+0000
Affected Version/sRelease 5.1.2
Fix Version/sn/a
Componentsn/a
LabelsCardView, android
ReporterAndrey Tkachenko
AssigneeUnknown
Created2016-02-06T21:30:53.000+0000
Updated2019-09-16T21:52:34.000+0000

Description

Where is red line?
<Alloy>
	<Window backgroundColor="#ffffff">		
		<CardView height="Ti.UI.SIZE" top="8" right="8" bottom="8" left="8">					
			<View backgroundColor="#ff0000" height="1" top="10" />			
			<Label>
				The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
			</Label>
		</CardView>
	</Window>
</Alloy>
My result: !CardView_bug.png|thumbnail!

Attachments

FileDateSize
CardView_bug.png2016-02-06T21:30:04.000+000077297

Comments

  1. Sharif AbuDarda 2016-02-07

    Hello, Define a width of the child view. I have tried this, and it's working. Thanks.
  2. Andrey Tkachenko 2016-02-07

    Yes it work with specific constant value BUT: This code not work (not visible). It is default value for view.width: [documentation](http://docs.appcelerator.com/platform/latest/#!/guide/Transitioning_to_the_New_UI_Layout_System-section-30088148_TransitioningtotheNewUILayoutSystem-AutoFillViews) This view must be visible with defult width property value. It is bug.
  3. Sharif AbuDarda 2016-02-07

    Hello, I have tested this in both Alloy and Classic project. If the child views width is not define or set as Ti.UI.FILL, 'auto', which is the default value the view does not show inside the CardView. View width '100%' works. This is a valid bug in the platform. As view has default FILL size for width of height. I have tested with SDK 5.1.2.GA

    TEST CODE

    Classic
       Ti.UI.backgroundColor = 'white';
       var win = Ti.UI.createWindow();
       
       var card = Ti.UI.Android.createCardView({
           contentPadding : 20,
           cardCornerRadius : 10,
           cardUseCompatPadding : true
       });
       
       var view = Titanium.UI.createView({
           backgroundColor : 'red',
           width : '100%',
           height : 50,
           top:0
       });
       card.add(view);
       var label = Ti.UI.createLabel({
           color : 'black',
           text : 'A long label with\na few line breaks\nand unicode (UTF8)\nsymbols such as\na white chess piece \u2655\nand the euro symbol \u20ac\nlooks like this!\n',
       });
       card.add(label);
       win.add(card);
       win.open();
       
    Alloy
       Provided Above
       
    Thanks.
  4. Andrey Tkachenko 2016-03-25

    Guys, 5.2.1.GA already out... Any news?
  5. Alan Hutton 2019-09-16

    Unable to reproduce with SDK 8.1.1.GA.

JSON Source