relativelayout

RelativeLayout differences between 1.5 and 2.1

假如想象 提交于 2019-12-04 11:18:47
I've got a ListView with items composed of RelativeLayouts. This is the relevant XML from the list items: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/xx" android:gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_centerInParent="true" android:layout_alignParentLeft="true"/> <TextView android:id="@+id/title" android:layout

How to show/hide grouped views in Android?

我与影子孤独终老i 提交于 2019-12-04 11:07:37
问题 I want to create an activity such as mentioned in photo... as soon as I press the maximize button I want it to become full screen for the activity and part 1 become minimize, and again when I press the restore button I want it to become in a first state: to be able to see part 1 and part 2 ... I think if we put two layouts it is possible? Isn't it? Please refer me to a resource to help me about this, or show me the code to achieve a solution. 回答1: Part one and two should be in their own

RelativeLayout as listview item

寵の児 提交于 2019-12-04 10:06:46
Consider following RelativeLayout as list view item: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/bigfoo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:text="bigfoo" android:textSize="60sp"/> <TextView android:id="@+id/foo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf

Android screenshot from code. Got it but not perfect

人盡茶涼 提交于 2019-12-04 08:46:10
问题 I'm trying to take a screenshot in code in Android. Actually the screenshot is the bitmap of the main RelativeLayout. The screenshot is taken but the content appears wrong, the fill_parent, etc tags are not respected and the image appears in the top left and with the original size. Please anyone, help. Thanks This is my code : RelativeLayout v = (RelativeLayout)findViewById(R.id.main_layout); v.setDrawingCacheEnabled(true); // this is the important code :) // Without it the view will have a /

textView lines - advice

删除回忆录丶 提交于 2019-12-04 06:41:20
问题 <RelativeLayout android:id="@+id/RelativeLayout1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:adjustViewBounds="true" android:src="@drawable/icon" /> <TextView android:id="@+id/fullnameTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android

Unable to get proper custom AlertDialog

放肆的年华 提交于 2019-12-04 06:14:03
问题 I have been trying to set a custom AlertDialog but was not able to get correctly. prompt.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#ffe3e3" xmlns:tools="http://schemas.android.com/tools" tools:ignore="HardcodedText"> <TextView android:id="@+id/prompttitile" android:layout_width="fill_parent" android:layout_height="wrap_content

Adding child views to Relative Layout

◇◆丶佛笑我妖孽 提交于 2019-12-04 05:12:44
问题 Though I have been through many questions regarding relative layout and adding child view programatically, I am unable to resolve this issue for (int i=0; i<views; i++) { ImageView img = new ImageView(this); LayoutParams img_params= new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); img_params.addRule(RelativeLayout.ALIGN_PARENT_LEFT|RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE); relativeLayout.addView(img, img_params); TextView textview = new TextView(this);

RelativeLayout causes animation not to work?

ⅰ亾dé卋堺 提交于 2019-12-04 04:12:20
I have an activity whose layout only contains a VideoView. Here is the xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <VideoView android:id="@+id/videoplayer" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentRight="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" > </VideoView> I am trying to apply this animation to the VideoView

Android, RelativeLayout restarts Marquee-TextView when changing ImageView in same RelativeLayout

北战南征 提交于 2019-12-04 03:48:24
问题 I have not found a solution for my problem, maybe you can help me here. I am using a RelativeLayout with an ImageView and a TextView as children. The TextView contains a large text and should scroll from right to left. But everytime when I set a new image to the ImageView, the marquee starts from beginning. I think that by setting a new image the TextView looses its focus and so the marquee starts again. How can I prevent that or is there something else I am doing wrong? Would be great if

How to wrap Image buttons in a horizontal linear layout?

守給你的承諾、 提交于 2019-12-04 02:42:44
Is there any way to wrap Image buttons in Horizontal Linear Layout? Or is there any other way to do the following thing? I have six image buttons. Suppose these buttons are appearing in a mid resolution device like this: Image button 1 | Image button 2 | Image button 3 | (1st row) Image button 4 | Image button 5 | Image button 6 | (2nd row) I want these buttons to appear in a tablet or any high resolution device like this: Image button 1 | Image button 2 | Image button 3 | Image button 4 | (1st row) Image button 5 | Image button 6 | (2nd row) Or like this: Image button 1 | Image button 2 |