android-linearlayout

Is it possible to add buttons to a framelayout that was set programmatically?

China☆狼群 提交于 2020-01-11 10:11:36
问题 this is somewhat of of difficult to describe issue but I'll do my very best: I am developing a an android app that uses a custom camera activity. In this camera activity I use create a surface view programmatically and set it to the framelayout (covers full screen) that was defined in the xml layout file. My question now is, how can I add other elements to the frame layout? Only programmatically? I am asking because as of now I was only able to add other elements programmatically. Elements

Is it possible to add buttons to a framelayout that was set programmatically?

独自空忆成欢 提交于 2020-01-11 10:11:27
问题 this is somewhat of of difficult to describe issue but I'll do my very best: I am developing a an android app that uses a custom camera activity. In this camera activity I use create a surface view programmatically and set it to the framelayout (covers full screen) that was defined in the xml layout file. My question now is, how can I add other elements to the frame layout? Only programmatically? I am asking because as of now I was only able to add other elements programmatically. Elements

ScrollView not scrolling at all

时间秒杀一切 提交于 2020-01-09 03:43:17
问题 I can't make a ScrollView properly scrolling. It always cut off the content on the bottom, as if it were a normal LinearLayout. My code <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" > <LinearLayout android:id="@+id/scroll_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:isScrollContainer="true" android:orientation="vertical" > Of

Layout dynamic grid in middle

霸气de小男生 提交于 2020-01-07 04:29:09
问题 I have a grid with (currently) four cells wide. Each cell I am specifying to be 20px wide. I want to position this in the middle and at the top of a portrait layout. My code is below. My problem is that hte grid seems to fill the whole width whereas it want it to just take number of columns * column width only. And for white space around it. I've put colours on each of the components to try and make it easy to see where each one is. The two views in the first LinearLayout are never shown. Ive

Android Adding more than one TextView to a TableRow Programmatically

折月煮酒 提交于 2020-01-07 04:21:43
问题 I have a LinearLayout inside a FrameLayout for tab purposes. And I'm trying to add TableRow's to the LinearLayout in the code. LinearLayout testLayout = (LinearLayout)findViewById(R.id.testLayout); TableRow tableRow = new TableRow(this); tableRow.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT)); This gets my LinearLayout and creates a TableRow to the specifications I want. I know this part is working. TextView textOne = new TextView(this); textOne

How to create a button on top of ImageView and align it to the bottom of the screen?

强颜欢笑 提交于 2020-01-07 02:18:28
问题 I want to have a button on top of ImageView using my xml file. When I run this code, the button appears to the left hand side of the screen on top of other buttons. Does anyone have any idea on what to do to have a button on TOP of ImageView but at the bottom of the screen. So far I have the following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...... <ImageView android:id="@+id/filter_image_view" android:layout_width=

How to create a button on top of ImageView and align it to the bottom of the screen?

天大地大妈咪最大 提交于 2020-01-07 02:18:24
问题 I want to have a button on top of ImageView using my xml file. When I run this code, the button appears to the left hand side of the screen on top of other buttons. Does anyone have any idea on what to do to have a button on TOP of ImageView but at the bottom of the screen. So far I have the following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...... <ImageView android:id="@+id/filter_image_view" android:layout_width=

Adding Buttons dynamically in RelativeLayout to LinearLayout

佐手、 提交于 2020-01-06 13:53:08
问题 When the user inputs a word, he creates a number of Buttons equal to the length of the word. For example: if user inputs "aaaa" he will create 4 Buttons , side by side, in the first row. Then if the user enters "bb" he will create 2 Buttons , side by side, in the second row. And "ccc" he creates 3 Buttons ... Image to demonstrate: I dynamically create a RelativeLayout , then dynamically add Buttons to that layout. And finally I add the RelativeLayout to my existing LinearLayout . But the

Adding Buttons dynamically in RelativeLayout to LinearLayout

ぃ、小莉子 提交于 2020-01-06 13:53:07
问题 When the user inputs a word, he creates a number of Buttons equal to the length of the word. For example: if user inputs "aaaa" he will create 4 Buttons , side by side, in the first row. Then if the user enters "bb" he will create 2 Buttons , side by side, in the second row. And "ccc" he creates 3 Buttons ... Image to demonstrate: I dynamically create a RelativeLayout , then dynamically add Buttons to that layout. And finally I add the RelativeLayout to my existing LinearLayout . But the

Round Border LinerLayout

≯℡__Kan透↙ 提交于 2020-01-06 09:06:07
问题 so the question How to add border around linear layout except at the bottom? answers my question partially but i cant seem to figure out how to make the corners round .. 回答1: Create a XML file named round_border in your layout folder. Now put this code in your XML file : <shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="4dp" android:color="#FF00FF00" /> <solid android:color="#ffffff" /> <padding android:left="7dp" android:top="7dp" android:right="7dp"