android


How to make search widget larger in actionbar?


XML code here
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android">
<EditText android:id="#+id/find_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:contentDescription="#string/find_text"
android:background="#drawable/url_bar_entry"
android:singleLine="true"
android:textColor="#000000"
android:textCursorDrawable="#null"
android:inputType="text"
android:paddingLeft="15dip"
android:paddingRight="15dip"
android:textColorHighlight="#color/url_bar_text_highlight"
android:imeOptions="actionSearch"
android:selectAllOnFocus="true"
android:gravity="center_vertical|left"/>
<ImageButton android:id="#+id/find_prev"
style="#style/FindBar.ImageButton"
android:contentDescription="#string/find_prev"
android:src="#drawable/find_prev"/>
<ImageButton android:id="#+id/find_next"
style="#style/FindBar.ImageButton"
android:contentDescription="#string/find_next"
android:src="#drawable/find_next"/>
<ImageButton android:id="#+id/find_close"
style="#style/FindBar.ImageButton"
android:contentDescription="#string/find_close"
android:src="#drawable/find_close"/>
</RelativeLayout>
I am inflating this menu by using this:
LayoutInflater inflater = LayoutInflater.from(mContext);
View content = inflater.inflate(R.layout.find_in_page_content, null);
EditText tv = (EditText) content.findViewById(R.id.find_text);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
tv.setLayoutParams(params);
//CODE TO ADD TO only EditText view to menu object I have
The outcome of this is seen here: http://imgur.com/sQZ7Lbh
My question is:, how can I make the url bar take up as much space as availble in the actiobar rather than be restricted to a tiny square. I also want the cursor to show up when pressed but it doesn't. However, I think that this is fixed when I make the url bar longer.
Set this gravity attribute in XML in your RelativeLayout
android:layout_gravity="fill_horizontal"
Taken from http://stackoverflow.com/a/12884297/2158970

Related Links

Library projects in Eclipse missing after Github clone?
Reading when write is restricted on Mifare Ultralight C
how to vary layout size based on different screen sizes in android? [duplicate]
Facebook SDK 3.18 - replacement for the deprecated facebook constructor
searchManager.getSearchableInfo(getComponentName()) returns null only in test
Features and libraries of Nexus 5 [closed]
Obtaining Build Target in android development
File.mkdirs warning from Android Studio
How to toast a message when an user come into a particular area in googlemaps
Android Jni : crash in global and local ref variables
pass context of activity in AdapterView.OnItemClickListener(){} nested in fragment - The method is undefined
Android start service after reboot without activity and loop a function
ArrayAdapter not working as expected
OutOfMemory Exception while encoding Base64 [duplicate]
getChildAt returns incorrect view in GridView
How to update imported modules with code modification from the their external library project in Gradle/Android Studio

Categories

HOME
fabricjs
scikit-learn
time-complexity
ggplot2
css3
pclxl
hugo
dkim
mod-security
php-5.6
speech-synthesis
selenium-ide
android-intent
libusb
babel
href
string-concatenation
resourcebundle
ms-access-2003
handler
ntp
kodi
git-squash
fstream
spring-security4
android-gridview
sendbird
searchkit
protege4
zoomify
health-monitoring
cin
wmp
dbnull
sharp-snmp
uiimage
ntvs
cpu-cache
objectscript
jtree
stripe-connect
cronexpression
usart
meteor-packages
stax
xcode-server
greatest-n-per-group
delta
lean
swizzling
http-status-code-401
cassia
cda
database-relations
directdraw
dynamics-nav-2016
sapi
pax-exam
.bash-profile
doctype
viola-jones
fail2ban
fits
variadic-templates
showdialog
structuremap3
deform
xml-namespaces
mintty
rcaller
fpdi
android-usb
scriptaculous
dtmf
modular
merb
onload-event
booksleeve
extreme-programming
nokia-s40
vfs
correlated-subquery
lr
dataform
presentation-layer
easyb
appliance
great-circle

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App