KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to align image to top of my Relative Layout and after that center it horizontally. Here is the code I'm using for : <ImageView android:id="@+id/collection_image_background" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" /> ,but this code is not working. My image is centered,but not aligned at top of my Relative Layout. I tried with android:scaleType="fitStart" , but it's actually align imag left and top of it's parent. So any idea how I can align the image correctly as I need? P.S. I forget to mention that I'm setting the image to my ImageView like this : BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inTempStorage = new byte[8*1024]; ops = BitmapFactory.decodeStream(cis,null,o2); ImageView view = (ImageView) findViewById(R.id.collection_image_background); view.setImageBitmap(ops);
Tags (comma-separated)
Save Edits
Cancel