relativelayout

Android - layout_weight not working

送分小仙女□ 提交于 2019-12-12 06:44:14
问题 Here is the 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="match_parent" android:background="@android:color/transparent" android:minHeight="40dp" > <LinearLayout android:id="@+id/contentLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/separatorView" android:weightSum="3" android:orientation="horizontal" >

Make a text view overlay another text view

假装没事ソ 提交于 2019-12-12 06:39:25
问题 I am try to make a text view over lay the above text view i have try'ed the text align but with no success i can accomplish this with adding a large amount of padding but i do not want to use padding because i run in to other issues in android variety in screen sizes. I will post an image of what i am trying to do and also post then xml code i have. Looking foward to some help here thanks.Image(I am trying to make that black bar with the text android /Design overlay the above area that says

setting margins on relative layout doesnt work

爷,独闯天下 提交于 2019-12-12 05:05:50
问题 I used a FragmentTransaction to add a Fragment into a FrameLayout. I want to dynamically change the margin of the RelativeLayout used by the Fragment. However, the margins are not changing with RelativeLayout.layoutParams. I also used setMargins() and it didnt work. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.infocard, container, false); RelativeLayout infoLayout = (RelativeLayout) view.findViewById

android button same height as textview

为君一笑 提交于 2019-12-12 04:53:18
问题 I am struggling creating the UI for a list item which should look like this: I am trying to build a similar layout for my list items like in the picture above. However, I am stuck, because I don't exactly know, how to nest the views so the sell-buttons has the same height as both textviews. If I use the RelativeLayout than I cannot use the layout_weight attribute anymore which position the views evenly horizontally on the screen. However, if I use the LinearLayout than I cannot use the

Android TABS with fragments

一个人想着一个人 提交于 2019-12-12 02:12:22
问题 I've been working on a small project that consists of a GUI with a number of tabs. I'm quite new with the concept of fragments however it seems that they're a best practice within the android tab landscape. I managed to code a simple tab app, that switches between 3 tabs. The only issue I have is when I try placing the tabs at the bottom of the screen. When they're at the bottom, the tab widget covers the container(framelayout in this case) and so nothing happens, the screen remains the same

Android Layout Design for normal screen sizes

房东的猫 提交于 2019-12-12 01:54:19
问题 I am a hobbiest app developer and I feel I have a good grasp on android basics but the main thing that I struggle at is app design. I understand how to develop for different screen sizes and densities. But the main thing I struggle at is each of the normal and other sizes cover such a range of sizes within their respective categories. I have been searching and searching and not been bale to find a solution. The main issue I am having is when designing using eclipse, i make a design using

How to create a regular, resizable grid without nested weights?

拟墨画扇 提交于 2019-12-12 01:39:22
问题 I've one of the simplest layouts imaginable: A num pad. I want to create a fragment containing a 3 x 4 grid of buttons. The layout should automatically resize the num pad to fill the available space. I've learned, that GridLayout is not up to the task, and TableLayout/TableRow or nesting LinearLayouts means nesting weights, which is also discouraged for performance reasons. A RelativeLayout won't work either, because that requires at least one button with given dimensions. So, is there a

So close to getting this layout down, RelativeLayout/LinearLayout woes

时光总嘲笑我的痴心妄想 提交于 2019-12-12 01:08:36
问题 I posted this question a week ago and didn't really understand what the people who responded meant. I was hoping to get some clarification. EDIT: I've gotten really close; actually, the closest I've been yet. This is my code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/background" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="52dp" android:layout_gravity=

Android RelativeLayout with wrap_content truncates some children

。_饼干妹妹 提交于 2019-12-12 00:35:25
问题 I have a RelativeLayout whose width/height is set to wrap_content. However, the button in the bottom right is truncated on its lower side. Changing the RelativeLayout's paddingBottom doesn't help, neither does adding a marginBottom to the button. Any ideas? Here's my code: <RelativeLayout android:id="@+id/sign_up_phase_enteraddress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:paddingTop="10dp" android:paddingRight="10dp"

Admob advertisement (Android) is to small

只谈情不闲聊 提交于 2019-12-11 20:26:28
问题 I placed a admob advertisement in my Android App (Block Crusher) and on QVGA the advertisment is smaller then the screen. On bigger resolutions there is no problem. I used the following xml to add the admob advertisement to the relative layout: <com.google.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" app:adSize="BANNER" app:adUnitId="0000000000" /> The width of my view is set to fill_parent and