android-relativelayout

How to put AdView in ConstraintLayout at bottom and below other stuff?

ぃ、小莉子 提交于 2020-01-12 13:53:32
问题 I'm trying to migrate from RelativeLayout to ConstraintLayout but I'm having problems adding the AdMob AdView to the bottom and the rest of the content above it. For example, using RelativeLayout was that simple. You only need to put android:layout_alignParentBottom="true" on the AdView and android:layout_above="@+id/adView" on the view which is containing the stuff. I'm trying to understand how to migrate this sample code and these two lines of code to the equivalent using a ConstraintLayout

How to put AdView in ConstraintLayout at bottom and below other stuff?

耗尽温柔 提交于 2020-01-12 13:53:10
问题 I'm trying to migrate from RelativeLayout to ConstraintLayout but I'm having problems adding the AdMob AdView to the bottom and the rest of the content above it. For example, using RelativeLayout was that simple. You only need to put android:layout_alignParentBottom="true" on the AdView and android:layout_above="@+id/adView" on the view which is containing the stuff. I'm trying to understand how to migrate this sample code and these two lines of code to the equivalent using a ConstraintLayout

Relative Layout alignParentLeft vs alignParentStart [duplicate]

家住魔仙堡 提交于 2020-01-11 17:49:25
问题 This question already has answers here : What is the difference between Android margin start/end and right/left? (2 answers) Closed 2 years ago . So I am comfortable with using relative layouts, but whilst getting used to Android Studio I noticed that in my relative layout child views it generated both of the following. android:layout_alignParentLeft="true" android:layout_alignParentStart="true I have checked out the Android docs here, but cannot see a distinction between the two. Certainly

z-index in Relative layout

北城以北 提交于 2020-01-10 00:53:11
问题 I need to place a TextView above the Button in RelativeLayout. But it is not working: TextView is always under the Button, even if I move it before the button. I also tried bringChildToFront() function to move textview on front, but no luck. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rlBottom" android:layout_width="fill_parent" android:layout_height="match_parent"> <Button android:id="@+id/bVio" android:layout_width="wrap_content" android

scrollview in RelativeLayout --android

好久不见. 提交于 2020-01-07 05:53:32
问题 i have one RelativeLayout and i have some views(image and edittexts) and now i want to use scrollview.this is a my xml code <RelativeLayout android:id="@+id/relativeLayout2" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_marginTop="70dp" > <ImageView android:id="@+id/loginbtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@

Android making bottom tool bar not move to top of layout

帅比萌擦擦* 提交于 2020-01-05 15:19:24
问题 This is sort of a continuation of , where I wanted to get a warning text at the bottom of my screen (below my bottom tool bar) when off line. When in offline mode looks correct: However when I hide the offline mode it pops to the top of the layout, like such (hiding everything I want to show): I tried setting the bottom tool bar to android:layout_alignParentBottom="true" , that does keep it from popping to the top when I hide the RelativeLayout with the TextView in it (Offline Mode) but then

Android making bottom tool bar not move to top of layout

你说的曾经没有我的故事 提交于 2020-01-05 15:18:34
问题 This is sort of a continuation of , where I wanted to get a warning text at the bottom of my screen (below my bottom tool bar) when off line. When in offline mode looks correct: However when I hide the offline mode it pops to the top of the layout, like such (hiding everything I want to show): I tried setting the bottom tool bar to android:layout_alignParentBottom="true" , that does keep it from popping to the top when I hide the RelativeLayout with the TextView in it (Offline Mode) but then

Programmatically adding items to a relative layout

孤者浪人 提交于 2020-01-03 07:23:13
问题 I have been searching everywhere for an answer to this question. I'm new to Android and attempting to add items to a relative layout programmatically through java instead of xml. I have created a test class to try it out but the items keep stacking instead of formatting correctly. I simply want one TextView under the other for now (eventually I will use the left of and right of parameters but I am starting simple. What am I missing? public void onCreate(Bundle savedInstanceState) { super

how to put a border around an android relativelayout?

岁酱吖の 提交于 2020-01-02 00:18:27
问题 I've seen this subject about puting a border around an android textview, and I used it. But now, I would like to put a border around widgets which are situated into a relative layout. How can I do it? 回答1: in your res/drawable folder, create a new file background_border.xml In this file, you will define the background for widget like this: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <!-- This is the stroke you want to define --> <stroke

ImageView adjustViewBounds not working with Relative Layout

浪尽此生 提交于 2020-01-01 09:23:12
问题 I have an ImageView and have set its layout_height to "100dp" and its layout_width to "wrap_content". The drawable used has bigger actual dimensions that are 130dp (width) X 215dp (height). When the ImageView is placed inside a LinearLayout , if I set adjustViewBounds to true, it gets a width that is measured according to the drawable's aspect ratio and the layout_width. However, when placed inside a RelativeLayout the ImageView gets the same width as the drawable (130dp), no matter the