First, I am adding Gridview and second i add imageview in the gridview, but the layout can't show up the image。
Does anyone know what the problem could be?
Thank you very much!!
Simply change the height and width attributes :)
Don't drag, use xml text editor instead. And as mentioned above use height and width appropriate.
Android Studio shows you a warning, next to the ImageView (yellow warning icon). If you hover over this, it will tell you what the problem is. (most likely missing height and width)
Related
I've got a problem and have no idea how to fix it. I'm using a ConstraintLayout in android
I want to set my TextView to wrap_content programmatically but respect my constraints.
Now the issue is that if i set my constriantWidth to WRAP_CONTENT it does not respect the constraints it's given to it.
I've found that there is a solution in xml in it here:
Wrap_content view inside a ConstraintLayout stretches outside the screen
but in this issue no where is it described how to set the property of constrainedwidth to true programmaticly.
I've tried a few things but have not found a solution to my problem:
set.constrainWidth(textView.getId(),ConstraintSet.WRAP_CONTENT)
just wraps the content without keeping in my constriants that i've set.
I've also tried to set the constraintedWidth with the ConstraintLayout.Params but nothing happend.
And i have no clue if en how i can set constrainedWidth in my ConstraintSet.
and
set.constrainWidth(textView.getId(),ConstraintSet.MATCH_CONSTRAINT_WRAP)
Just makes my text a thin line of my text and doesn't show my text anymore.
If someone could help i would be very great full.
PS. Sorry for my english not a native speaker.
Use constrainDefaultWidth:
set.constrainDefaultHeight(textView.getId(), ConstraintSet.MATCH_CONSTRAINT_WRAP);
I need to add a scrollable android TextView, which will show alot of text.
I want to achieve this kind of effect:
But I found no way of doing so.
Is there any good way of doing it?
Thank you!
try below properties to TextView
android:requiresFadingEdge="vertical"
android:fadingEdgeLength="32dp" //To change the gradient overlay height
The most convient way of doing this is creating a drawable. You can either make your own image in the image editing software of your choice or create a GradientDrawable. Make sure the colors go from white to transparent. Then place this drawable on top of the textview near the bottom.
The padding in the left the image below don't look good. I want to remove that. How can I remove that?
Please mention measurement also means "dp" or you can remove these two property from layout..
android:padding_left="0dp"
android:padding_right="0dp"
try put android:padding_left="0" and android:margin_left="0"
i am creating a listview with custom arrayadapter..but the problem is in tablet it's showing the listitem is very small.. can any1 help me,
Thanks in advance
try to make the width of the listview fixed. you can do it in the corresponding layout xml file. there you add property like android:layout_width="200dp"
To fix this issue remove static variables ie, fixed values. Create dynamic xmls with fill_parent, match_parent.
Thanks...
http://youtu.be/Td4Ziujb_kI
Can't think of any reason why it's doing this. That app is just a TextBox and Button in a relative layout, very very basic.
Could not you do small effort to paste your xml instead of this crap ??
any two, possible reasons are :
1) you defined textView as fill_parent width and height so no space for EditText .
2)Editext width/height is zero .