hi i just fixed the issue i had with
my application, now i am stuck with
another problem, please help :)
most of my code is here
"unknown Exception android"
now i want to make my main page look like this as shown in iphone
application given below,
"http://wwwm.coventry.ac.uk/app/Pages/iPhoneApp.aspx"
i dont know if i need to use tab activity or option menu or inflator,
as for call, email and web, i will have to call services as far as i
know.
and last if i can see any tutorial or code which will help me to solve my
problem, please give me a link.
thanks alot**
Main.xml looks like this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<AbsoluteLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="#+id/AbsoluteLayout01">
<TextView android:layout_x="61dip" android:layout_y="176dip" android:id="#+id/TextView02" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="#string/courses"></TextView>
<ImageButton android:id="#+id/CoursesButton" android:layout_x="62dip" android:layout_y="107dip" android:background="#drawable/a" android:layout_height="65dp" android:layout_width="65dp"></ImageButton>
<TextView android:gravity="center" android:textSize="25dp" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="#string/LabelNescot" android:layout_x="1dip" android:layout_y="39dip" android:id="#+id/TextView"></TextView>
<ImageButton android:id="#+id/ILoveNescotButton" android:background="#drawable/b" android:layout_height="65dp" android:layout_width="65dp" android:layout_x="179dip" android:layout_y="106dip"></ImageButton>
<ImageButton android:id="#+id/GettingHereButton" android:background="#drawable/d" android:layout_height="65dp" android:layout_width="65dp" android:layout_x="185dip" android:layout_y="208dip"></ImageButton>
<TextView android:id="#+id/TextView05" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="#string/Directions" android:layout_x="182dip" android:layout_y="283dip"></TextView>
<TextView android:id="#+id/TextView03" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="#string/facility" android:layout_x="180dip" android:layout_y="177dip"></TextView>
<ImageButton android:background="#drawable/c" android:id="#+id/CampusMapButton" android:layout_height="65dp" android:layout_width="65dp" android:layout_x="48dip" android:layout_y="208dip"></ImageButton>
<TextView android:text="#string/Map" android:layout_height="wrap_content" android:id="#+id/TextView04" android:layout_width="wrap_content" android:layout_x="37dip" android:layout_y="285dip"></TextView>
</AbsoluteLayout>
z
</LinearLayout>
Hello Tab Layout.
Related
Basically I am confused with the xml file for each chat entry with content wrapped like whatsapp. I have tried doing it using framelayout and Relativelayout but it didn't work. Message is not wrapped around the time.
<FrameLayout
android:id="#+id/chat_mine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="#drawable/chat_bg_white"
>
<TextView
android:id="#+id/chat_text_mine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="65dp"
android:gravity="center|left"
android:text="h"
android:textSize="#dimen/font_size3" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
>
<TextView
android:id="#+id/chat_time_mine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:gravity="right|bottom"
android:singleLine="true"
android:text=" 2:00 am"
android:textSize="#dimen/font_size4" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_delivered" />
</LinearLayout>
</FrameLayout>
Not sure what you are trying to ask here ? If I understand it correct, edit you frame layout to show something first. This will help you see contents in ur preview.
<FrameLayout
android:id="#+id/chat_mine"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="#drawable/chat_bg_white"
>
this may sound trivial but I am currently having difficulty in the display of the LikeButton. It does not look as intended.
It is supposed to look like this.
https://s3.amazonaws.com/uploads.hipchat.com/20645/978150/Pm1GbfbVvhpmjVU/Screen%20Shot%202014-10-24%20at%2010.25.15%20AM.png
Instead it looks like the following:
https://s3.amazonaws.com/uploads.hipchat.com/20645/978150/JEuU1CEq3Dvmzjj/Screen%20Shot%202014-10-24%20at%2010.27.56%20AM.png
Notice the extra long blue space being stretched and "Like" text being extremely small in the second pic.
Here is the code for the layout file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layoutFacebookLike"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:screenOrientation="sensorLandscape" >
<TextView
android:id="#+id/textFacebookIncentiveText"
style="#style/Huge"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:padding="48dp"
android:text="#string/txt_facebook_incentive_default"
android:textColor="#android:color/white" />
<RelativeLayout
android:id="#+id/layoutFacebookLikeContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#40000000"
android:layout_gravity="center"
android:gravity="center_horizontal">
<Button
android:id="#+id/btnContinue"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="32dp"
android:paddingBottom="16dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="16dp"
android:text="#string/btn_continue"
android:layout_alignParentLeft="false"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/white"
android:layout_centerInParent="true" />
<com.facebook.widget.LikeView
android:id="#+id/likeView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="64dp"
android:layout_centerInParent="true"
android:textAlignment="gravity"
android:layout_alignParentBottom="false"
android:layout_alignParentLeft="false" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
The code in the activity that I am using is as follows:
LikeView mLikeButton = (LikeView) findViewById(R.id.likeView1);
mLikeButton.setObjectId("121083561691");
mLikeButton.setLikeViewStyle(LikeView.Style.STANDARD);
mLikeButton.setAuxiliaryViewPosition(LikeView.AuxiliaryViewPosition.INLINE);
mLikeButton.setHorizontalAlignment(LikeView.HorizontalAlignment.CENTER);
mLikeButton.setForegroundColor(Color.WHITE);
Please let me know how I can correct it.
This issue arises when you have some themes and styling already set for the activity which interferes with the design of the LikeButton. If you set the default values, the Like Button appears normal.
In the graphical view of layout, when I choose API 15 or lower from the button shown in the image below, the text in the encircled buttons looks fine.
When I choose API 17, the text is displaced even though the xml code is same. Changing the button padding does not help.
Is this just a problem with Eclipse or is it possible that new versions of android may see this displaced text?
What's the workaround to fix this?
XML code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="3dp" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="#drawable/label" />
</LinearLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/linearLayout1"
android:layout_below="#+id/linearLayout1"
android:layout_marginTop="20dp"
android:text="#string/about_title"
android:textSize="20sp" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignRight="#+id/linearLayout1"
android:layout_below="#+id/textView1"
android:layout_marginTop="5dp"
android:text="#string/temp" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_alignRight="#+id/textView2"
android:layout_below="#+id/textView2"
android:layout_marginTop="20dp"
android:baselineAligned="false" >
<Button
android:id="#+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/news" />
<Button
android:id="#+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/tournaments" />
<Button
android:id="#+id/button3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/results" />
</LinearLayout>
android:gravity="center" did not help
I restarted eclipse twice. Strangely it did not help in the first restart but it looked fine after the second one. Also, its working fine on device.
Apologies for the question, I must have waited before posting the question.
Not sure if the default style for Buttons changed in API17... possibly...
Anyway, adding android:gravity="center" should be fixing this for you.
i don't know i faced this problem check restart a eclipse.. and check..
adding android:gravity="center" should be fixing this for you
I have the following layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/widget30"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/v_fundo"
>
<ImageView
android:id="#+id/imageView1"
android:layout_height="wrap_content"
android:src="#drawable/v_titulo"
android:layout_width="wrap_content"
android:layout_alignParentLeft="true">
</ImageView>
<RelativeLayout android:layout_height="wrap_content" android:id="#+id/relativeLayout2" android:layout_width="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true">
<ImageView android:id="#+id/widget32" android:layout_height="wrap_content" android:layout_width="wrap_content" android:background="#drawable/v_personagem"> </ImageView>
<Button android:layout_height="wrap_content" android:background="#drawable/v_balao" android:layout_width="wrap_content" android:id="#+id/lastComicButton"></Button>
</RelativeLayout>
<ImageView android:src="#drawable/v_transparente" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="#+id/imageView2" android:layout_alignParentBottom="true"></ImageView>
<RelativeLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="#+id/relativeLayout1" android:background="#drawable/funcoes_fundo" android:layout_above="#+id/imageView2" android:layout_alignLeft="#+id/imageView2" android:layout_alignRight="#+id/imageView2">
<Button android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:id="#+id/button2"
android:text="Yes, we can!"
android:background="#drawable/funcoes_1">
</Button>
<Button android:layout_height="65dp"
android:layout_alignRight="#+id/button2"
android:layout_alignLeft="#+id/button2"
android:layout_width="250dp"
android:id="#+id/button1"
android:layout_below="#+id/button2"
android:background="#drawable/funcoes_2">
</Button>
</RelativeLayout>
The button with id button2 (android:id="#+id/button2") shows the text fine in the Emulator and on the Milestone II.
However, when I put the .apk into the Motorola Defy, the image background of the button hides its text ("Yes, we can!"). I am sure of that because if I don't show the background (by deleting the line android:background="#drawable/funcoes_1"), the text is shown fine in the button.
Does anybody have any clue on why the background image of the Button is hiding its text in some devices (like the Motorola Defy)?
Thank you in advance!
android:layout_alignRight="#+id/button2"
android:layout_alignLeft="#+id/button2"
android:layout_below="#+id/button2"
These should all be set to either "true" or "false". These properties are used to determine in a RelativeLayout the "relative" gravity/alignment of a member.
Declaring android:id="#+button2" once is enough.
What is likely happening is the device it doesn't work on has an older or different version of Android that is not tolerant of this error.
Hope this helped.
I'm working on a UI that has a bunch of images and buttons, but since they're too long to fit on one screen, I decided to put it in a ScrollView. Problem is, once I do that, everything disappears except my first image. Here's my code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/bg"
android:baselineAligned="true"
android:orientation="vertical">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/scrollView1">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView1"
android:src="#drawable/header3000"
android:layout_gravity="center"
android:layout_marginTop="10dip"></ImageView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView2"
android:src="#drawable/websitetuneup"
android:layout_gravity="center_horizontal"></ImageView>
<Button
android:layout_width="wrap_content"
android:text="Read More" android:id="#+id/readmore_w1"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"></Button>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView3"
android:src="#drawable/inboundmarketing"
android:layout_marginLeft="15dip"></ImageView>
<Button
android:layout_width="wrap_content"
android:text="Read More" android:id="#+id/readmore_w2"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="15dip"></Button>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView4"
android:src="#drawable/socialmedia"
android:layout_marginLeft="15dip"></ImageView>
<Button
android:layout_width="wrap_content"
android:text="Read More" android:id="#+id/readmore_w3"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"></Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
Here's what it looks like
Notice how the first image appears fine, but all the rest are minimized into a small portion to the right of the image.
How should I fix this? Thanks in advance for your help, and sorry for the long post
The orientation of second LinearLayout is not defined. It seems it is takes as horizontal by default. Try the veritical one.